aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/insane.bbclass2
-rw-r--r--classes/mono.bbclass58
-rw-r--r--conf/bitbake.conf2
-rw-r--r--conf/checksums.ini4
-rw-r--r--conf/distro/angstrom-2008.1.conf5
-rw-r--r--conf/distro/include/moko-autorev.inc3
-rw-r--r--conf/distro/include/preferred-xorg-versions-X11R7.3.inc2
-rw-r--r--conf/distro/include/sane-srcrevs.inc15
-rw-r--r--conf/machine/alix.conf6
-rw-r--r--conf/machine/at91sam9260ek.conf6
-rw-r--r--conf/machine/at91sam9261ek.conf6
-rw-r--r--conf/machine/bd-neon.conf56
-rw-r--r--conf/machine/cm-x270.conf20
-rw-r--r--conf/machine/epia.conf2
-rw-r--r--conf/machine/fic-gta02.conf3
-rw-r--r--conf/machine/guinness.conf2
-rw-r--r--conf/machine/i586-generic.conf2
-rw-r--r--conf/machine/i686-generic.conf2
-rw-r--r--conf/machine/include/zaurus-2.6.inc3
-rw-r--r--conf/machine/netvista.conf2
-rw-r--r--conf/machine/progear.conf2
-rw-r--r--conf/machine/qemux86.conf2
-rw-r--r--conf/machine/wrap.conf2
-rw-r--r--conf/machine/x86-32-nocona.conf2
-rw-r--r--conf/machine/x86-prescott.conf2
-rw-r--r--conf/machine/x86.conf2
-rw-r--r--contrib/armmon_xfer/.mtn2git_empty (renamed from packages/linux/compulab-pxa270-2.6.22/.mtn2git_empty)0
-rwxr-xr-xcontrib/armmon_xfer/armmon_xfer.py150
-rw-r--r--contrib/mono/.mtn2git_empty (renamed from packages/linux/linux-efika-2.6.20.11/.mtn2git_empty)0
-rw-r--r--contrib/mono/collect-files.py118
-rw-r--r--contrib/mtn2git/.mtn2git_empty0
-rwxr-xr-xcontrib/mtn2git/git2mtn.py50
-rw-r--r--contrib/mtn2git/mtn/.mtn2git_empty0
-rw-r--r--contrib/mtn2git/mtn/__init__.py6
-rw-r--r--contrib/mtn2git/mtn/authors.py11
-rw-r--r--contrib/mtn2git/mtn/common.py49
-rwxr-xr-xcontrib/mtn2git/mtn/genproxy.py25
-rw-r--r--contrib/mtn2git/mtn/mtn.py419
-rw-r--r--contrib/mtn2git/mtn/utility.py100
-rwxr-xr-xcontrib/mtn2git/mtn2git.py610
-rw-r--r--contrib/mtn2git/status.py47
-rw-r--r--packages/bind/bind-9.3.4-P1/.mtn2git_empty0
-rw-r--r--packages/bind/bind-9.3.4-P1/conf.patch301
-rw-r--r--packages/bind/bind-9.3.4-P1/configure.in.patch14
-rw-r--r--packages/bind/bind-9.3.4-P1/so_bsdcompat.patch34
-rw-r--r--packages/bind/bind_9.3.4-P1.bb38
-rw-r--r--packages/binutils/binutils-2.18/binutils-configure-texinfo-version.patch22
-rw-r--r--packages/binutils/binutils_2.18.bb1
-rw-r--r--packages/bluez/bluez-cups-backend_3.20.bb26
-rw-r--r--packages/bluez/bluez-gstreamer-plugin_3.20.bb26
-rw-r--r--packages/bluez/bluez-libs_3.20.bb1
-rw-r--r--packages/bluez/bluez-utils-alsa_3.20.bb24
-rw-r--r--packages/bluez/bluez-utils_3.20.bb29
-rw-r--r--packages/busybox/busybox-1.7.2/.mtn2git_empty0
-rw-r--r--packages/busybox/busybox-1.7.2/angstrom/.mtn2git_empty0
-rw-r--r--packages/busybox/busybox-1.7.2/angstrom/defconfig647
-rwxr-xr-xpackages/busybox/busybox-1.7.2/busybox-mdev.sh69
-rw-r--r--packages/busybox/busybox-1.7.2/defconfig647
-rw-r--r--packages/busybox/busybox-1.7.2/udhcpscript.patch17
-rw-r--r--packages/busybox/busybox_1.7.2.bb119
-rw-r--r--packages/dropbear/dropbear.inc2
-rw-r--r--packages/gcc/gcc-4.2.2/.mtn2git_empty0
-rw-r--r--packages/gcc/gcc-4.2.2/100-uclibc-conf.patch200
-rw-r--r--packages/gcc/gcc-4.2.2/103-uclibc-conf-noupstream.patch11
-rw-r--r--packages/gcc/gcc-4.2.2/110-arm-eabi.patch27
-rw-r--r--packages/gcc/gcc-4.2.2/200-uclibc-locale.patch2790
-rw-r--r--packages/gcc/gcc-4.2.2/203-uclibc-locale-no__x.patch213
-rw-r--r--packages/gcc/gcc-4.2.2/204-uclibc-locale-wchar_fix.patch48
-rw-r--r--packages/gcc/gcc-4.2.2/205-uclibc-locale-update.patch347
-rw-r--r--packages/gcc/gcc-4.2.2/300-libstdc++-pic.patch46
-rw-r--r--packages/gcc/gcc-4.2.2/301-missing-execinfo_h.patch11
-rw-r--r--packages/gcc/gcc-4.2.2/302-c99-snprintf.patch11
-rw-r--r--packages/gcc/gcc-4.2.2/303-c99-complex-ugly-hack.patch12
-rw-r--r--packages/gcc/gcc-4.2.2/304-index_macro.patch24
-rw-r--r--packages/gcc/gcc-4.2.2/305-libmudflap-susv3-legacy.patch49
-rw-r--r--packages/gcc/gcc-4.2.2/306-libstdc++-namespace.patch36
-rw-r--r--packages/gcc/gcc-4.2.2/307-locale_facets.patch26
-rw-r--r--packages/gcc/gcc-4.2.2/402-libbackend_dep_gcov-iov.h.patch13
-rw-r--r--packages/gcc/gcc-4.2.2/602-sdk-libstdc++-includes.patch20
-rw-r--r--packages/gcc/gcc-4.2.2/740-sh-pr24836.patch25
-rw-r--r--packages/gcc/gcc-4.2.2/800-arm-bigendian.patch67
-rw-r--r--packages/gcc/gcc-4.2.2/801-arm-bigendian-eabi.patch14
-rw-r--r--packages/gcc/gcc-4.2.2/904-flatten-switch-stmt-00.patch153
-rw-r--r--packages/gcc/gcc-4.2.2/README4
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-20000320.patch11
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-32bit-disable.patch85
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable-4.2.0.patch169
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable0.patch47
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-and-or.patch67
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-cfcvt64-disable.patch19
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-cfcvtds-disable.patch32
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-cirrus-bugfixes.patch573
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-compare-geu.patch48
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch98
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch-z-eq98
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-compare.patch400
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-compare.patch-z-eq400
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-dominance.patch12
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754-div.patch139
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754.patch100
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-eabi.patch64
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable-single.patch38
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable.patch61
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-floatunsidf.patch37
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-fp_consts.patch13
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-neg.patch30
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-neg2.patch25
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-offset.patch20
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-predicates.patch20
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-predicates2.patch10
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-predicates3.patch116
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-saveregs.patch153
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-scc.patch38
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable-new.patch33
-rw-r--r--packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable.patch56
-rw-r--r--packages/gcc/gcc-4.2.2/arm-nolibfloat.patch24
-rw-r--r--packages/gcc/gcc-4.2.2/arm-softfloat.patch16
-rw-r--r--packages/gcc/gcc-4.2.2/arm-thumb-cache.patch29
-rw-r--r--packages/gcc/gcc-4.2.2/arm-thumb.patch64
-rw-r--r--packages/gcc/gcc-4.2.2/cache-amnesia.patch13
-rw-r--r--packages/gcc/gcc-4.2.2/fix-ICE-in-arm_unwind_emit_set.diff18
-rw-r--r--packages/gcc/gcc-4.2.2/gcc41-configure.in.patch22
-rw-r--r--packages/gcc/gcc-4.2.2/ldflags.patch22
-rw-r--r--packages/gcc/gcc-4.2.2/sdk-libstdc++-includes.patch22
-rw-r--r--packages/gcc/gcc-4.2.2/sh3-installfix-fixheaders.patch11
-rw-r--r--packages/gcc/gcc-4.2.2/unbreak-armv4t.patch12
-rw-r--r--packages/gcc/gcc-4.2.2/zecke-no-host-includes.patch31
-rw-r--r--packages/gcc/gcc-4.2.2/zecke-xgcc-cpp.patch12
-rw-r--r--packages/gcc/gcc-cross-initial_4.2.2.bb5
-rw-r--r--packages/gcc/gcc-cross_4.2.1.bb2
-rw-r--r--packages/gcc/gcc-cross_4.2.2.bb20
-rw-r--r--packages/gcc/gcc_4.2.1.bb2
-rw-r--r--packages/gcc/gcc_4.2.2.bb83
-rw-r--r--packages/glib-2.0/glib-2.0-2.14.0/gcc-4.2-inline-fix.patch17
-rw-r--r--packages/glib-2.0/glib-2.0-2.14.1/.mtn2git_empty0
-rw-r--r--packages/glib-2.0/glib-2.0-2.14.1/configure-libtool.patch29
-rw-r--r--packages/glib-2.0/glib-2.0-2.14.1/gcc-4.2-inline-fix.patch17
-rw-r--r--packages/glib-2.0/glib-2.0_2.14.0.bb3
-rw-r--r--packages/glib-2.0/glib-2.0_2.14.1.bb6
-rw-r--r--packages/gnutls/gnutls_1.6.2.bb6
-rw-r--r--packages/gnutls/gnutls_1.6.3.bb2
-rwxr-xr-xpackages/gpephone/gpe-session-scripts-phone/phonesession1
-rw-r--r--packages/gpephone/gpe-session-scripts-phone_0.67.bb2
-rw-r--r--packages/gstreamer/gst-plugins.inc2
-rw-r--r--packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb2
-rw-r--r--packages/gtk-webcore/osb-jscore_20070816.bb2
-rw-r--r--packages/gtk-webcore/osb-jscore_svn.bb4
-rw-r--r--packages/gtk-webcore/osb-nrcit_20070816.bb2
-rw-r--r--packages/gtk-webcore/osb-nrcit_svn.bb7
-rw-r--r--packages/gtk-webcore/osb-nrcore_20070816.bb2
-rw-r--r--packages/gtk-webcore/osb-nrcore_svn.bb4
-rw-r--r--packages/hal/ohm_git.bb6
-rw-r--r--packages/icu/icu-3.6.inc2
-rw-r--r--packages/images/altboot-console-image.bb (renamed from packages/angstrom/angstrom-altboot-console-image.bb)2
-rw-r--r--packages/images/altboot-x11-image.bb (renamed from packages/angstrom/angstrom-altboot-x11-image.bb)2
-rw-r--r--packages/images/bootmanager-image.bb (renamed from packages/angstrom/angstrom-bootmanager-image.bb)0
-rw-r--r--packages/images/console-image.bb (renamed from packages/angstrom/angstrom-console-image.bb)0
-rw-r--r--packages/images/gateway-image.bb (renamed from packages/angstrom/angstrom-gateway-image.bb)0
-rw-r--r--packages/images/minimal-image-with-mtd-utils.bb (renamed from packages/images/angstrom-minimal-image-with-mtd-utils.bb)2
-rw-r--r--packages/images/minimal-image.bb (renamed from packages/images/angstrom-minimal-image.bb)0
-rw-r--r--packages/images/mokogateway-image.bb (renamed from packages/angstrom/angstrom-mokogateway-image.bb)0
-rw-r--r--packages/images/x11-gpe-image.bb (renamed from packages/angstrom/angstrom-x11-gpe-image.bb)0
-rw-r--r--packages/images/x11-image.bb (renamed from packages/angstrom/angstrom-x11-image.bb)0
-rw-r--r--packages/images/x11-office-image.bb (renamed from packages/angstrom/angstrom-x11-office-image.bb)2
-rw-r--r--packages/images/x11-pimlico-image.bb (renamed from packages/angstrom/angstrom-x11-pimlico-image.bb)0
-rw-r--r--packages/libtiff/tiff-3.7.2/.mtn2git_empty0
-rw-r--r--packages/libtiff/tiff-3.7.2/configure.patch20
-rw-r--r--packages/libtiff/tiff_3.7.2.bb5
-rw-r--r--packages/libw100/libw100_svn.bb4
-rw-r--r--packages/linux/compulab-pxa270_2.6.22.bb67
-rw-r--r--packages/linux/linux-2.6.21/gumstix-verdex/defconfig9
-rw-r--r--packages/linux/linux-2.6.21/tsc2003-config.diff31
-rw-r--r--packages/linux/linux-2.6.21/tsc2003.c557
-rw-r--r--packages/linux/linux-2.6.22/.mtn2git_empty0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/.mtn2git_empty0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0001-cm-x270-base2.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0001-cm-x270-base2.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0002-cm-x270-match-type.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0002-cm-x270-match-type.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0003-cm-x270-ide.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0003-cm-x270-ide.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0004-cm-x270-it8152.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0004-cm-x270-it8152.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0005-cm-x270-pcmcia.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0005-cm-x270-pcmcia.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0006-ramdisk_load.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0006-ramdisk_load.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0007-mmcsd_large_cards-r0.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0007-mmcsd_large_cards-r0.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0008-cm-x270-nand-simplify-name.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0008-cm-x270-nand-simplify-name.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/0009-cursor-fix.patch (renamed from packages/linux/compulab-pxa270-2.6.22/0009-cursor-fix.patch)0
-rw-r--r--packages/linux/linux-2.6.22/cm-x270/defconfig (renamed from packages/linux/compulab-pxa270-2.6.22/defconfig)0
-rw-r--r--packages/linux/linux-2.6.23/.mtn2git_empty0
-rw-r--r--packages/linux/linux-2.6.23/binutils-buildid-arm.patch16
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/.mtn2git_empty0
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0001-cm-x270-base2.patch2851
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0002-cm-x270-match-type.patch25
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0003-cm-x270-ide.patch186
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0004-cm-x270-it8152.patch496
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch228
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0006-ramdisk_load.patch80
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0007-mmcsd_large_cards-r0.patch36
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/0008-cm-x270-nand-simplify-name.patch25
-rw-r--r--packages/linux/linux-2.6.23/cm-x270/defconfig1204
-rw-r--r--packages/linux/linux-bd-neon-2.6-2.6.22/.mtn2git_empty0
-rw-r--r--packages/linux/linux-bd-neon-2.6-2.6.22/neon-jffs2-config.patch33
-rw-r--r--packages/linux/linux-bd-neon-2.6_2.6.22.bb48
-rw-r--r--packages/linux/linux-efika-2.6.20.20/.mtn2git_empty0
-rw-r--r--packages/linux/linux-efika-2.6.20.20/sched-cfs-v9-v2.6.20.11.patch (renamed from packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch)0
-rw-r--r--packages/linux/linux-efika-2.6.20.20/weaken-div64_32-symbol.patch23
-rw-r--r--packages/linux/linux-efika-2.6.20/defconfig133
-rw-r--r--packages/linux/linux-efika_2.6.20.20.bb (renamed from packages/linux/linux-efika_2.6.20.11.bb)8
-rw-r--r--packages/linux/linux-handhelds-2.6.inc2
-rw-r--r--packages/linux/linux-openmoko-devel/defconfig-2.6.23-rc9 (renamed from packages/linux/linux-openmoko-devel/defconfig)219
-rw-r--r--packages/linux/linux-openmoko-devel/squashfs-2.6.23.patch4395
-rw-r--r--packages/linux/linux-openmoko-devel_svn+2.6.23-rc9.bb (renamed from packages/linux/linux-openmoko-devel_svn.bb)22
-rw-r--r--packages/linux/linux.inc9
-rw-r--r--packages/linux/linux_2.6.21.bb13
-rw-r--r--packages/linux/linux_2.6.22.bb53
-rw-r--r--packages/linux/linux_2.6.23.bb63
-rw-r--r--packages/llvm/llvm-gcc4-cross_svn.bb2
-rw-r--r--packages/llvm/llvm-native_2.1.bb (renamed from packages/llvm/llvm-native_2.0.bb)2
-rw-r--r--packages/lm_sensors/files/prefix-fix.patch14
-rw-r--r--packages/lm_sensors/lmsensors-apps_2.10.1.bb14
-rw-r--r--packages/logrotate/logrotate_3.7.1.bb2
-rw-r--r--packages/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb6
-rw-r--r--packages/mono/mono_1.2.5.1-files.inc1634
-rw-r--r--packages/mono/mono_1.2.5.1.bb123
-rw-r--r--packages/mplayer/files/mplayer-imageon-svn.patch19
-rw-r--r--packages/mplayer/files/pxa_configure.patch4
-rw-r--r--packages/mplayer/mplayer_svn.bb17
-rw-r--r--packages/mtd/mtd-utils-native.inc6
-rw-r--r--packages/mtd/mtd-utils-native_1.0.0+git.bb1
-rw-r--r--packages/mtd/mtd-utils_1.0.0+git.bb2
-rw-r--r--packages/musicpd/mpd-alsa_svn.bb22
-rw-r--r--packages/openmoko-panel-plugins/openmoko-panel-bt_svn.bb2
-rw-r--r--packages/openmoko2/libmokojournal2_svn.bb4
-rw-r--r--packages/openmoko2/openmoko-sound-system2/session2
-rw-r--r--packages/openmoko2/openmoko-sound-system2_0.1.0.bb2
-rw-r--r--packages/openmoko2/openmoko-sound-theme-standard2_svn.bb4
-rw-r--r--packages/python/python-pygobject-native_2.12.2.bb3
-rw-r--r--packages/python/python-pygobject-native_2.12.3.bb2
-rw-r--r--packages/python/python-pygobject_2.12.2.bb23
-rw-r--r--packages/qmake/qmake2-native-2.10a/use-lflags-last.patch22
-rw-r--r--packages/qmake/qmake2-native_2.10a.bb1
-rw-r--r--packages/rxvt-unicode/rxvt-unicode_7.9.bb6
-rw-r--r--packages/sylpheed/claws-mail.inc46
-rw-r--r--packages/sylpheed/claws-mail_2.7.2.bb41
-rw-r--r--packages/sylpheed/claws-mail_2.9.1.bb1
-rw-r--r--packages/sylpheed/claws-mail_3.0.2.bb (renamed from packages/sylpheed/claws-mail_3.0.1.bb)0
-rw-r--r--packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.2.bb (renamed from packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.14.1.bb)0
-rw-r--r--packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.bb20
-rw-r--r--packages/sylpheed/claws-plugin-maildir_0.24.4.bb20
-rw-r--r--packages/sylpheed/claws-plugin-mailmbox_1.12.4.bb20
-rw-r--r--packages/sylpheed/claws-plugin-mailmbox_1.14.bb (renamed from packages/sylpheed/claws-plugin-mailmbox_1.13.bb)0
-rw-r--r--packages/sylpheed/claws-plugin-rssyl_0.15.bb (renamed from packages/sylpheed/claws-plugin-rssyl_0.13.bb)0
-rw-r--r--packages/tasks/task-base.bb2
-rw-r--r--packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty0
-rw-r--r--packages/tslib/tslib-1.0/bd-neon/ts.conf5
-rw-r--r--packages/tslib/tslib-1.0/bd-neon/tslib.sh6
-rw-r--r--packages/tslib/tslib_1.0.bb2
-rw-r--r--packages/uboot/u-boot-1.1.2/u-boot-1.1.2-neon.patch19204
-rw-r--r--packages/uboot/u-boot_1.1.2.bb3
-rw-r--r--packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-001-fix-mmap.patch91
-rw-r--r--packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-conditional-sched_affinity.patch53
-rw-r--r--packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-gethostent_r-failure-retval.patch12
-rw-r--r--packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-internal_function-definition.patch51
-rw-r--r--packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-rm-whitespace.patch86
-rw-r--r--packages/uclibc/uclibc_0.9.29.bb9
-rw-r--r--packages/vlan/vlan_1.9.bb24
-rw-r--r--packages/webkit/webkit-gtk_svn.bb7
-rw-r--r--packages/xorg-xserver/xserver-kdrive/gumstix-kmode.patch23
-rw-r--r--packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb8
-rw-r--r--packages/yaffs2/yaffs2-utils-native_cvs.bb2
267 files changed, 43367 insertions, 675 deletions
diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index 83f8c43bba..3fb2d04a81 100644
--- a/classes/insane.bbclass
+++ b/classes/insane.bbclass
@@ -42,7 +42,7 @@ def package_qa_get_machine_dict():
"i486": ( 3, 0, 0, True, True),
"i586": ( 3, 0, 0, True, True),
"i686": ( 3, 0, 0, True, True),
- "x64_64": (62, 0, 0, True, False),
+ "x86_64": (62, 0, 0, True, False),
"ia64": (50, 0, 0, True, False),
"alpha": (36902, 0, 0, True, False),
"hppa": (15, 3, 0, False, True),
diff --git a/classes/mono.bbclass b/classes/mono.bbclass
index c50274ed0c..b7c5439b86 100644
--- a/classes/mono.bbclass
+++ b/classes/mono.bbclass
@@ -1,61 +1,3 @@
-def mono_get_file_table(packageversion, d):
- # The packageversion is currently ignored, but might be used in the future
- # if more than one mono version is available and different versions
- # need to use different tables
-
- import bb, sys, os, glob, commands
- curdir = os.path.dirname( bb.data.getVar('FILE', d, 1) )
- if curdir not in sys.path: sys.path.append( curdir )
- from mono_files import debian_mono_file_table
-
- # mono-jay is not being built (for all platforms at least)
- IGNORE = ("mono-jay", )
- file_table = [
- # Standard package
- {"name": "mono-doc"},
-
- # Virtual packages
- {"name": "mono"},
- {"name": "mono-runtime"},
-
- # Not provided by Debian:
- {"name": "libnunit2.2-cil",
- "patterns": [
- "/usr/lib/mono/gac/nunit.*/2.2.*",
- "/usr/lib/mono/1.0/nunit.*.dll",
- "/usr/lib/pkgconfig/mono-nunit.pc",
- ],
- "assemblies": [
- ("nunit.core", "2.2.0.0"),
- ("nunit.framework", "2.2.0.0"),
- ("nunit.util", "2.2.0.0"),
- ("nunit.mocks", "2.2.8.0"),
- ],
- },
- {"name": "libmono-cecil0.5-cil",
- "patterns": [
- "/usr/lib/mono/gac/Mono.Cecil/0.5.*",
- ],
- "assemblies": [
- ("Mono.Cecil", "0.5.*"),
- ],
- },
- {"name": "libmono-db2-1.0-cil",
- "patterns": [
- "/usr/lib/mono/gac/IBM.Data.DB2/1.0*",
- "/usr/lib/mono/1.0/IBM.Data.DB2.dll",
- ],
- "assemblies": [
- ("IBM.Data.DB2", "1.0*"),
- ],
- },
- ] + debian_mono_file_table
-
- file_table = [e for e in file_table
- if not (e.has_key("name") and e["name"] in IGNORE)]
-
- return file_table
-
def mono_find_provides_and_requires(files, d):
provides = []
requires = []
diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 5d06cff32b..799823f3f4 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -210,7 +210,7 @@ IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
IMAGE_CMD = ""
IMAGE_CMD_jffs2 = "mkfs.jffs2 -x lzo --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${EXTRA_IMAGECMD}"
-IMAGE_CMD_yaffs2 = "mkyaffs2image ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.yaffs2 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_yaffs2 = "mkyaffs2image 1 ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.yaffs2 ${EXTRA_IMAGECMD}"
IMAGE_CMD_cramfs = "mkcramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cramfs ${EXTRA_IMAGECMD}"
IMAGE_CMD_ext2 = "genext2fs -b ${IMAGE_ROOTFS_SIZE} -d ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2 ${EXTRA_IMAGECMD}"
IMAGE_CMD_ext2.gz = "rm -rf ${DEPLOY_DIR_IMAGE}/tmp.gz && mkdir ${DEPLOY_DIR_IMAGE}/tmp.gz; genext2fs -b ${IMAGE_ROOTFS_SIZE} -d ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2 ${EXTRA_IMAGECMD}; gzip -f -9 ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2; mv ${DEPLOY_DIR_IMAGE}/tmp.gz/${IMAGE_NAME}.rootfs.ext2.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2.gz; rmdir ${DEPLOY_DIR_IMAGE}/tmp.gz"
diff --git a/conf/checksums.ini b/conf/checksums.ini
index 27b9e87e92..2f5e67c762 100644
--- a/conf/checksums.ini
+++ b/conf/checksums.ini
@@ -6406,6 +6406,10 @@ sha256=986a923a5247468db1d2a03e93268f4025ae5dc27e911dafc7b37e6a802122db
md5=866ba97420f5ce978b6a6b1cb4338890
sha256=17b82323151925ff5a7ad09a21781a0fa50ead4b87a339cee262271e4ededa13
+[http://llvm.org/releases/2.1/llvm-2.1.tar.gz]
+md5=b930e7213b37acc934d0d163cf13af18
+sha256=8cabd422f249ada736d864fc8a1f4d14aabefacb6f860c9beefbc53f93e0f96c
+
[http://lsc.fie.umich.mx/%7esadit/spyro/download/SPyDI-0.9.3.tar.gz]
md5=9f54fc8a40e26edd61ce67902b315a66
sha256=07675051b60343820b235a818f2c2d528b86d2a19c2f56833213e3f574f9cd1a
diff --git a/conf/distro/angstrom-2008.1.conf b/conf/distro/angstrom-2008.1.conf
index cdf2970201..046c63ad54 100644
--- a/conf/distro/angstrom-2008.1.conf
+++ b/conf/distro/angstrom-2008.1.conf
@@ -8,7 +8,7 @@
# Use Xorg R7.3 release
-require conf/distro/include/preferred-xorg-versions-X11R7.2.inc
+require conf/distro/include/preferred-xorg-versions-X11R7.3.inc
# This is a testbed for unstable and/or untested things, while angstrom-2007.1
@@ -45,3 +45,6 @@ PREFERRED_VERSION_pango = "1.18.1"
# prefer newest for speed and fun
PREFERRED_VERSION_udev = "115"
+# Our patched-to-hell busybox 1.2.1 is getting old and unmaintanable
+PREFERRED_VERSION_busybox = "1.7.2"
+
diff --git a/conf/distro/include/moko-autorev.inc b/conf/distro/include/moko-autorev.inc
index c4d478ccde..0cba28de58 100644
--- a/conf/distro/include/moko-autorev.inc
+++ b/conf/distro/include/moko-autorev.inc
@@ -61,3 +61,6 @@ SRCREV_pn-openocd ?= "${AUTOREV}"
SRCREV_pn-openocd-native ?= "${AUTOREV}"
SRCREV_pn-uboot-openmoko ?= "${AUTOREV}"
+SRCREV_pn-dfu-util ?= "${AUTOREV}"
+SRCREV_pn-dfu-util-native ?= "${AUTOREV}"
+
diff --git a/conf/distro/include/preferred-xorg-versions-X11R7.3.inc b/conf/distro/include/preferred-xorg-versions-X11R7.3.inc
index 19ee48174d..d7e19284bc 100644
--- a/conf/distro/include/preferred-xorg-versions-X11R7.3.inc
+++ b/conf/distro/include/preferred-xorg-versions-X11R7.3.inc
@@ -71,7 +71,7 @@ PREFERRED_VERSION_xcursorgen ?= "1.0.2"
PREFERRED_VERSION_xdbedizzy ?= "1.0.2"
PREFERRED_VERSION_xditview ?= "1.0.1"
PREFERRED_VERSION_xdm ?= "1.1.6"
-PREFERRED_VERSION_xdpyinfo ?= "1.0.1"
+PREFERRED_VERSION_xdpyinfo ?= "1.0.2"
PREFERRED_VERSION_xdriinfo ?= "1.0.2"
PREFERRED_VERSION_xedit ?= "1.0.2"
PREFERRED_VERSION_xev ?= "1.0.1"
diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc
index 008881ed99..f46177620e 100644
--- a/conf/distro/include/sane-srcrevs.inc
+++ b/conf/distro/include/sane-srcrevs.inc
@@ -20,9 +20,9 @@ SRCREV_pn-gnuradio ?= "6377"
SRCREV_pn-hildon-1 ?= "14173"
SRCREV_pn-libgsmd ?= "3074"
SRCREV_pn-libmokogsmd2 ?= "2950"
-SRCREV_pn-libmokojournal2 ?= "2780"
+SRCREV_pn-libmokojournal2 ?= "3118"
SRCREV_pn-libmokopanelui2 ?= "2958"
-SRCREV_pn-libmokoui2 ?= "3064"
+SRCREV_pn-libmokoui2 ?= "3111"
SRCREV_pn-libowl ?= "277"
SRCREV_pn-libxosd ?= "627"
SRCREV_pn-linux-hackndev-2.6 ?= "1308"
@@ -30,10 +30,10 @@ SRCREV_pn-llvm-gcc4 ?= "374"
SRCREV_pn-llvm-gcc4-cross ?= "374"
SRCREV_pn-maemo-mapper ?= "108"
SRCREV_pn-matchbox-desktop-2 ?= "1649"
-SRCREV_pn-matchbox-keyboard ?= "1675"
-SRCREV_pn-matchbox-keyboard-inputmethod ?= "1675"
+SRCREV_pn-matchbox-keyboard ?= "1739"
+SRCREV_pn-matchbox-keyboard-inputmethod ?= "1739"
SRCREV_pn-matchbox-panel-2 ?= "1626"
-SRCREV_pn-moko-gtk-engine ?= "3069"
+SRCREV_pn-moko-gtk-engine ?= "3146"
SRCREV_pn-neod ?= "2956"
SRCREV_pn-oh-puzzles ?= "22"
SRCREV_pn-osb-browser ?= "125"
@@ -48,11 +48,11 @@ SRCREV_pn-openmoko-calculator2 ?= "2789"
SRCREV_pn-openmoko-common ?= "397"
SRCREV_pn-openmoko-common2 ?= "2679"
SRCREV_pn-openmoko-contacts ?= "2298"
-SRCREV_pn-openmoko-contacts2 ?= "350"
+SRCREV_pn-openmoko-contacts2 ?= "358"
SRCREV_pn-openmoko-dates ?= "467"
SRCREV_pn-openmoko-dates2 ?= "617"
SRCREV_pn-openmoko-dialer ?= "2811"
-SRCREV_pn-openmoko-dialer2 ?= "3073"
+SRCREV_pn-openmoko-dialer2 ?= "3141"
SRCREV_pn-openmoko-feedreader2 ?= "3080"
SRCREV_pn-openmoko-finger-demo ?= "1671"
SRCREV_pn-openmoko-firststart2 ?= "2873"
@@ -100,4 +100,5 @@ SRCREV_pn-xoo ?= "1623"
SRCREV_pn-mplayer ?= "24587"
SRCREV_pn-networkmanager ?= "2887"
SRCREV_pn-networkmanager-applet ?= "200"
+SRCREV_pn-libw100 ?= "47"
diff --git a/conf/machine/alix.conf b/conf/machine/alix.conf
index 29af29a3b8..3c50ef561b 100644
--- a/conf/machine/alix.conf
+++ b/conf/machine/alix.conf
@@ -1,6 +1,6 @@
#@TYPE: Machine
#@NAME: Alix
-#@DESCRIPTION: Machine configuration for PC Engines Alix1c board
+#@DESCRIPTION: Machine.inciguration for PC Engines Alix1c board
#
# http://pcengines.ch/alix1c.htm
@@ -15,9 +15,9 @@ OLDEST_KERNEL = "2.6.17"
GLIBC_ADDONS = "nptl"
GLIBC_EXTRA_OECONF = "--with-tls"
-MACHINE_FEATURES = "kernel26 usbhost ext2 pci screen alsa acpi"
+MACHINE_FEATURES = "kernel26 usbhost ext2 pci screen alsa acpi x86"
-require conf/machine/include/tune-geodelx.conf
+require.inc/machine/include/tune-geodelx.inc
IMAGE_FSTYPES += "tar.gz"
diff --git a/conf/machine/at91sam9260ek.conf b/conf/machine/at91sam9260ek.conf
index e8903a960a..f00938cc4e 100644
--- a/conf/machine/at91sam9260ek.conf
+++ b/conf/machine/at91sam9260ek.conf
@@ -1,6 +1,6 @@
#@TYPE: Machine
#@Name: Atmel AT91SAM9260EK Development Platform
-#@DESCRIPTION: Machine configuration for the at91sam9260ek development board with a at91sam9260 processor
+#@DESCRIPTION: Machine.inciguration for the at91sam9260ek development board with a at91sam9260 processor
TARGET_ARCH = "arm"
PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
@@ -8,6 +8,8 @@ PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"
+KERNEL_IMAGETYPE = "uImage"
+
#don't try to access tty1
USE_VT = "0"
@@ -17,4 +19,4 @@ MACHINE_FEATURES = "kernel26 alsa ext2 usbhost usbgadget"
SERIAL_CONSOLE = "115200 ttyS0"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
-require conf/machine/include/tune-arm926ejs.conf
+require.inc/machine/include/tune-arm926ejs.inc
diff --git a/conf/machine/at91sam9261ek.conf b/conf/machine/at91sam9261ek.conf
index 489575cd2b..e59dacbc86 100644
--- a/conf/machine/at91sam9261ek.conf
+++ b/conf/machine/at91sam9261ek.conf
@@ -1,6 +1,6 @@
#@TYPE: Machine
#@Name: Atmel AT91SAM9261EK Development Platform
-#@DESCRIPTION: Machine configuration for the at91sam9261ek development board with a at91sam9261 processor
+#@DESCRIPTION: Machine.inciguration for the at91sam9261ek development board with a at91sam9261 processor
TARGET_ARCH = "arm"
PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
@@ -8,6 +8,8 @@ PACKAGE_EXTRA_ARCHS = "armv4t armv5te"
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"
+KERNEL_IMAGETYPE = "uImage"
+
#don't try to access tty1
USE_VT = "0"
@@ -17,4 +19,4 @@ MACHINE_FEATURES = "kernel26 alsa ext2 usbhost usbgadget screen touchscreen"
SERIAL_CONSOLE = "115200 ttyS0"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
-require conf/machine/include/tune-arm926ejs.conf
+require.inc/machine/include/tune-arm926ejs.inc
diff --git a/conf/machine/bd-neon.conf b/conf/machine/bd-neon.conf
new file mode 100644
index 0000000000..bd6354a2e4
--- /dev/null
+++ b/conf/machine/bd-neon.conf
@@ -0,0 +1,56 @@
+#@TYPE: Machine
+#@NAME: Boundary Devices NEON
+#@DESCRIPTION: Machine.inciguration for the Boundary Devices NEON board
+
+#
+# Hardware-based properties
+#
+TARGET_ARCH = "arm"
+PACKAGE_EXTRA_ARCHS = "armv4 armv4t armv5te"
+
+# Use tune-xscale per default. Machine independent feeds should be built with tune-strongarm.
+require.inc/machine/include/tune-xscale.inc
+
+# Uncomment this to use iwmmxt optimizations. Remove the above xscale stuff first
+#require.inc/machine/include/tune-iwmmxt.inc
+
+ROOT_FLASH_SIZE = "60"
+VOLATILE_STORAGE_SIZE = "128"
+GUI_MACHINE_CLASS = "bigscreen"
+MACHINE_FEATURES = "kernel26 touchscreen apm alsa usbgadget screen uboot"
+
+#
+# Software/packages selection
+#
+PREFERRED_PROVIDER_virtual/kernel = "linux-bd-neon-2.6"
+MODUTILS = "26"
+XSERVER = "xserver-kdrive-fbdev"
+MACHINE_TASK_PROVIDER = "task-base"
+
+PREFERRED_VERSION_u-boot = "1.1.2"
+
+EXTRA_IMAGEDEPENDS =" mtd-utils"
+
+MACHINE_EXTRA_RDEPENDS = " mtd-utils"
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-module-nls-cp437 \
+ kernel-module-nls-iso8859-1 \
+ kernel-module-nls-utf8 \
+ kernel-module-af-key \
+ kernel-module-i2c-pxa"
+
+EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 -n"
+EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x40000 --pad=32243712; sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs-summary.jffs2 \
+ -e 128KiB -p"
+
+#
+# Modules autoload and other boot properties
+#
+module_autoload_evdev = "evdev"
+module_autoload_mmc_block = "mmc_block"
+module_autoload_snd-pcm-oss = "snd-pcm-oss"
+module_autoload_snd-mixer-oss = "snd-mixer-oss"
+
+#module_autoload_g_ether = "g_ether"
+
+SERIAL_CONSOLE = "115200 ttyS0"
diff --git a/conf/machine/cm-x270.conf b/conf/machine/cm-x270.conf
index c712c3728e..2522897042 100644
--- a/conf/machine/cm-x270.conf
+++ b/conf/machine/cm-x270.conf
@@ -3,11 +3,12 @@
#@DESCRIPTION: Machine configuration for Compulab cm-x270 computer module
#OLDEST_KERNEL = "2.6.16"
TARGET_ARCH = "arm"
-PREFERRED_VERSION_compulab-pxa270 = "2.6.22"
GUI_MACHINE_CLASS ?= "bigscreen"
-PREFERRED_PROVIDER_virtual/kernel = "compulab-pxa270"
-PACKAGE_EXTRA_ARCHS = "armv4 armv5te"
+PREFERRED_PROVIDER_virtual/kernel = "linux"
+PREFERRED_VERSION_linux = "2.6.23"
+
+PACKAGE_EXTRA_ARCHS = "armv4 armv4t armv5te iwmmxt"
require conf/machine/include/tune-xscale.inc
@@ -16,6 +17,13 @@ require conf/machine/include/tune-xscale.inc
# the following line to your local.conf:
# CMX270_CONSOLE_SERIAL_PORT = "ttyS0"
+# NAND flash eraseblock size
+# most of the older cm-x270 modules are populated with NAND flash
+# that have 128KiB eraseblocks. Recently, a user encounted
+# a device that has 16KiB eraseblocks. The following define
+# can be overridden in local.conf if you have one of these devices.
+CMX270_NAND_ERASEBLOCK_SIZE ?= "0x20000"
+
# the following is for the cm-x270 L module
CMX270_CONSOLE_SERIAL_PORT ?= "ttyS1"
@@ -31,16 +39,16 @@ SERIAL_CONSOLE ?= "38400 ${CMX270_CONSOLE_SERIAL_PORT}"
ROOT_FLASH_SIZE ?= "32"
# for NAND flash.
-EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 --pad --no-cleanmarkers;\
+EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=${CMX270_NAND_ERASEBLOCK_SIZE} --pad --no-cleanmarkers;\
sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs-summary.jffs2 \
- -e 0x20000 -p; \
+ -e ${CMX270_NAND_ERASEBLOCK_SIZE} -p; \
cd ${DEPLOY_DIR_IMAGE}; \
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs-summary.jffs2; \
ln -s ${IMAGE_NAME}.rootfs-summary.jffs2 ${IMAGE_LINK_NAME}.rootfs-summary.jffs2 \
"
-MACHINE_FEATURES = "kernel26 pcmcia usbhost usbgadget pcmcia touchscreen alsa"
+MACHINE_FEATURES = "kernel26 pcmcia usbhost usbgadget pcmcia touchscreen alsa iwmmxt"
# to program the compulab NAND flash, the following scheme is suggested. Create
# a small rootfs that can fit in NOR flash using the following config:
diff --git a/conf/machine/epia.conf b/conf/machine/epia.conf
index 0750e4d646..69d5e66171 100644
--- a/conf/machine/epia.conf
+++ b/conf/machine/epia.conf
@@ -12,7 +12,7 @@ GLIBC_EXTRA_OECONF = "--with-tls"
IMAGE_FSTYPES = "ext2.gz"
-MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2"
+MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2 x86"
MACHINE_TASK_PROVIDER = "task-base"
require conf/machine/include/tune-c3.inc
diff --git a/conf/machine/fic-gta02.conf b/conf/machine/fic-gta02.conf
index 99eb9f0832..ac85afc48c 100644
--- a/conf/machine/fic-gta02.conf
+++ b/conf/machine/fic-gta02.conf
@@ -44,3 +44,6 @@ EXTRA_IMAGEDEPENDS += "sjf2410-linux-native dfu-util-native"
# tune for S3C24x0
include conf/machine/include/tune-arm920t.inc
+
+# build YAFFS2
+IMAGE_FSTYPES =+ "yaffs2"
diff --git a/conf/machine/guinness.conf b/conf/machine/guinness.conf
index 626e755b1f..f17451556f 100644
--- a/conf/machine/guinness.conf
+++ b/conf/machine/guinness.conf
@@ -17,7 +17,7 @@ OLDEST_KERNEL = "2.6.17"
GLIBC_ADDONS = "nptl"
GLIBC_EXTRA_OECONF = "--with-tls"
-MACHINE_FEATURES = "kernel26 usbhost ext2 pci acpi screen"
+MACHINE_FEATURES = "kernel26 usbhost ext2 pci acpi screen x86"
#require conf/machine/include/tune-athlonmp.inc
diff --git a/conf/machine/i586-generic.conf b/conf/machine/i586-generic.conf
index 0ef522441b..53e088da1c 100644
--- a/conf/machine/i586-generic.conf
+++ b/conf/machine/i586-generic.conf
@@ -19,7 +19,7 @@ GLIBC_EXTRA_OECONF = "--with-tls"
IMAGE_FSTYPES = "ext2.gz"
-MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2"
+MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2 x86"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
MACHINE_TASK_PROVIDER = "task-base"
diff --git a/conf/machine/i686-generic.conf b/conf/machine/i686-generic.conf
index 8ff87553ba..b8e73f3085 100644
--- a/conf/machine/i686-generic.conf
+++ b/conf/machine/i686-generic.conf
@@ -18,7 +18,7 @@ GLIBC_EXTRA_OECONF = "--with-tls"
IMAGE_FSTYPES = "ext2.gz"
-MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2"
+MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2 x86"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
MACHINE_TASK_PROVIDER = "task-base"
diff --git a/conf/machine/include/zaurus-2.6.inc b/conf/machine/include/zaurus-2.6.inc
index 979a6bd484..4bcd36e2ab 100644
--- a/conf/machine/include/zaurus-2.6.inc
+++ b/conf/machine/include/zaurus-2.6.inc
@@ -21,7 +21,8 @@ include conf/machine/include/tune-xscale.inc
SERIAL_CONSOLE = "115200 ttyS0"
PREFERRED_PROVIDER_virtual/kernel = "linux-rp"
-PREFERRED_PROVIDER_xserver = "xserver-kdrive"
+PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive"
+
PCMCIA_MANAGER ?= "pcmciautils"
diff --git a/conf/machine/netvista.conf b/conf/machine/netvista.conf
index 8d6cd2d220..3ee97a447e 100644
--- a/conf/machine/netvista.conf
+++ b/conf/machine/netvista.conf
@@ -15,7 +15,7 @@ KERNEL_IMAGETYPE = "bzImage"
# BOOTSTRAP_EXTRA_RDEPENDS = "kernel pciutils udev kernel-modules"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
-MACHINE_FEATURES = "kernel26 pci usbhost ext2 screen keyboard irda apm alsa"
+MACHINE_FEATURES = "kernel26 pci usbhost ext2 screen keyboard irda apm alsa x86"
ROOT_FLASH_SIZE = "64"
GUI_MACHINE_CLASS = "bigscreen"
diff --git a/conf/machine/progear.conf b/conf/machine/progear.conf
index ffa7dad468..2a8c009b10 100644
--- a/conf/machine/progear.conf
+++ b/conf/machine/progear.conf
@@ -15,7 +15,7 @@ OLDEST_KERNEL = "2.6.17"
GLIBC_ADDONS = "nptl"
GLIBC_EXTRA_OECONF = "--with-tls"
-MACHINE_FEATURES = "kernel26 usbhost ext2 pci pcmcia screen alsa irda acpi screen touchscreen"
+MACHINE_FEATURES = "kernel26 usbhost ext2 pci pcmcia screen alsa irda acpi screen touchscreen x86"
IMAGE_FSTYPES = "tar.gz"
diff --git a/conf/machine/qemux86.conf b/conf/machine/qemux86.conf
index 2378a9990e..fe811ba54e 100644
--- a/conf/machine/qemux86.conf
+++ b/conf/machine/qemux86.conf
@@ -7,6 +7,8 @@ PACKAGE_EXTRA_ARCHS = "x86"
require conf/machine/include/qemu.inc
+MACHINE_FEATURES += "x86"
+
KERNEL_IMAGETYPE = "bzImage"
SERIAL_CONSOLE = "115200 ttyS0"
diff --git a/conf/machine/wrap.conf b/conf/machine/wrap.conf
index d73c80214c..92720043f2 100644
--- a/conf/machine/wrap.conf
+++ b/conf/machine/wrap.conf
@@ -22,7 +22,7 @@ USE_DEVFS = "0"
IMAGE_FSTYPE ?= "tar.gz"
# Things to include in the fs image
-MACHINE_FEATURES = "kernel26 pci ext2"
+MACHINE_FEATURES = "kernel26 pci ext2 x86"
# The kernel and grub need to installed to boot from flash
MACHINE_EXTRA_RDEPENDS = "kernel grub"
diff --git a/conf/machine/x86-32-nocona.conf b/conf/machine/x86-32-nocona.conf
index ad5badf84a..e52454ed52 100644
--- a/conf/machine/x86-32-nocona.conf
+++ b/conf/machine/x86-32-nocona.conf
@@ -17,7 +17,7 @@ GLIBC_EXTRA_OECONF = "--with-tls"
IMAGE_FSTYPES = "ext2.gz"
-MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2"
+MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2 x86"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
MACHINE_TASK_PROVIDER = "task-base"
diff --git a/conf/machine/x86-prescott.conf b/conf/machine/x86-prescott.conf
index b4021a6496..bd96c387b6 100644
--- a/conf/machine/x86-prescott.conf
+++ b/conf/machine/x86-prescott.conf
@@ -16,7 +16,7 @@ GLIBC_EXTRA_OECONF = "--with-tls"
IMAGE_FSTYPES = "ext2.gz"
-MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2"
+MACHINE_FEATURES = "kernel26 screen keyboard pci ushbost acpi ext2 x86"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
MACHINE_TASK_PROVIDER = "task-base"
diff --git a/conf/machine/x86.conf b/conf/machine/x86.conf
index 51757e950c..c35e7ad389 100644
--- a/conf/machine/x86.conf
+++ b/conf/machine/x86.conf
@@ -13,7 +13,7 @@ KERNEL_IMAGETYPE = "bzImage"
# BOOTSTRAP_EXTRA_RDEPENDS = "kernel pciutils udev kernel-modules"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
-MACHINE_FEATURES = "kernel26 pci usbhost ext2 screen"
+MACHINE_FEATURES = "kernel26 pci usbhost ext2 screen x86"
udevdir = "/dev"
OLDEST_KERNEL = "2.6.17"
diff --git a/packages/linux/compulab-pxa270-2.6.22/.mtn2git_empty b/contrib/armmon_xfer/.mtn2git_empty
index e69de29bb2..e69de29bb2 100644
--- a/packages/linux/compulab-pxa270-2.6.22/.mtn2git_empty
+++ b/contrib/armmon_xfer/.mtn2git_empty
diff --git a/contrib/armmon_xfer/armmon_xfer.py b/contrib/armmon_xfer/armmon_xfer.py
new file mode 100755
index 0000000000..d7a9b7281d
--- /dev/null
+++ b/contrib/armmon_xfer/armmon_xfer.py
@@ -0,0 +1,150 @@
+#!/usr/bin/python
+
+# Small utility to upload kernel and/or ramdisk to
+# the compulab board through the ARMmon firmware.
+# Requires pyserial : http://pyserial.sourceforge.net
+# author: Tobias Pflug
+
+import sys, os, serial, getopt, atexit, re
+
+# regular expression to match valid IPv4 addresses
+ipv4_regex = r"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
+
+def wait_flash_complete():
+ while 1:
+ data = s.readline()
+ if quiet != 1:
+ print data,
+ if data.split(" ")[0] == "Finished":
+ break
+
+def test_armmon():
+ # write some nonsense to the monitor and
+ # check if armmon replies accordingly
+ s.write("nonsense\n")
+ s.timeout=2
+ s.read(len("nonsense\n")+1)
+ data = s.read(len("Illegal"))
+ if data.split(" ")[0] != "Illegal":
+ sys.exit("Error: ARMmon not responding. Linux running maybe?")
+ s.timeout=None
+ s.flushInput()
+ s.flushOutput()
+
+
+def usage():
+ sys.stderr.write("""USAGE: %s [options] <server ip>
+ armmon_xfer - data upload tool for cmx270/ARMmon
+
+ options:
+ -p, --port=PORT: serial port, default='/dev/ttyUSB0'
+ -k, --kernel=KERNEL: upload and flash kernel image KERNEL
+ -r, --ramdisk=RAMDISK: upload and flash ramdisk image RAMDISK
+ -b, --bootos: boot Linux
+ -R, --reboot: reboot cmx270
+ -q, --quiet be quiet, little output
+ -h, --help: print this help screen
+
+""" % (sys.argv[0],))
+
+if __name__ == '__main__':
+
+ port = "/dev/ttyUSB0"
+ baud = 38400
+ kernel = None
+ ramdisk = None
+ boot = None
+ reboot = None
+ quiet = None
+ tftp_ip = None
+
+ if len(sys.argv) < 2:
+ usage()
+ sys.exit(0)
+
+ # parse command line
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:],
+ "p:k:r:bRhq",
+ ["port=", "kernel=","ramdisk=","bootos","reboot","help","quiet"]
+ )
+ except getopt.GetoptError:
+ usage()
+ sys.exit(2)
+
+ for o, a in opts:
+ if o in ("-h","--help"):
+ usage()
+ sys.exit()
+ elif o in ("-k","--kernel"):
+ kernel = a
+ elif o in ("-r","--ramdisk"):
+ ramdisk = a
+ elif o in ("-b","--bootos"):
+ boot = 1
+ elif o in ("-R","--reboot"):
+ reboot = 1
+ elif o in ("-p","--port"):
+ port = o
+ elif o in ("-q","--quiet"):
+ quiet = 1
+
+ # check for arguments and validate IP address
+ # when required by commands
+ if len(args)>0 and re.match(ipv4_regex,args[0]):
+ tftp_ip = args[0]
+ else:
+ if kernel or ramdisk:
+ sys.exit("Error: invalid IP address!")
+
+ try:
+ s = serial.Serial('/dev/ttyUSB0',38400)
+ except:
+ sys.stderr.write("Error: Could not open port: %s\n" % (port))
+ sys.exit(1)
+
+ # test if armmon is responding on bogus input
+ test_armmon()
+
+ # carry out commands
+
+ if reboot:
+ print "Rebooting compulab ..."
+ s.write("reboot\n")
+ s.write("y\n")
+ s.write("y\n")
+ s.close()
+ sys.exit(0)
+
+ if kernel:
+ print "Downloading kernel ..."
+ cmd = "download kernel tftp %s %s\n" % (kernel,tftp_ip)
+ s.write(cmd)
+ data = s.readline()
+ data = s.readline()
+
+ print "Flashing kernel ..."
+ cmd = "flash kernel\n"
+ s.write(cmd)
+ wait_flash_complete()
+
+
+ if ramdisk:
+ print "Downloading ramdisk ..."
+ cmd = "download ramdisk tftp %s %s\n" % (ramdisk,tftp_ip)
+ s.write(cmd)
+ s.readline()
+ s.readline()
+
+ print "Flashing ramdisk ..."
+ cmd = "flash ramdisk\n"
+ s.write(cmd)
+ wait_flash_complete()
+
+ if boot:
+ print "Booting Linux ..."
+ s.write("bootos\n")
+
+ s.close()
+ sys.exit(0)
diff --git a/packages/linux/linux-efika-2.6.20.11/.mtn2git_empty b/contrib/mono/.mtn2git_empty
index e69de29bb2..e69de29bb2 100644
--- a/packages/linux/linux-efika-2.6.20.11/.mtn2git_empty
+++ b/contrib/mono/.mtn2git_empty
diff --git a/contrib/mono/collect-files.py b/contrib/mono/collect-files.py
new file mode 100644
index 0000000000..c353667b19
--- /dev/null
+++ b/contrib/mono/collect-files.py
@@ -0,0 +1,118 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+## This utility takes the debian directory from an unpacked debian mono source
+## tree (e.g. apt-get source mono), parses the *.install files and generates a
+## bitbake include file with the file and package lists. It tries to handle -dbg
+## packages by creating additional glob patterns for *.mdb and */.debug/*. Most
+## of these will not match, but that's fine (I think).
+## -- Henryk Plötz <henryk@openmoko.org>
+##
+##The output looks like:
+##FILES_mono-jit-dbg = "/usr/bin/mono*.mdb \
+## /usr/bin/mono*/*.mdb"
+##FILES_mono-jit = "/usr/bin/mono"
+##FILES_mono-gac-dbg = "/usr/bin/gacutil*.mdb \
+## /usr/bin/gacutil*/*.mdb \
+## /usr/lib/mono/1.0/gacutil.exe*.mdb \
+## /usr/lib/mono/1.0/gacutil.exe*/*.mdb"
+##FILES_mono-gac = "/usr/bin/gacutil \
+## /usr/lib/mono/1.0/gacutil.exe"
+## ...
+##PACKAGES = "mono-jit-dbg \
+## mono-jit \
+## mono-gac-dbg \
+## mono-gac \
+## ...
+
+import os, sys, re
+
+def collect_paths(dir):
+ paths = {}
+
+ os.chdir(dir)
+ for filename in os.listdir("."):
+ if filename.endswith(".install"):
+ fp = file(filename, "r")
+ lines = fp.readlines()
+ fp.close()
+
+ contents = []
+ for line in lines:
+ line = line.strip()
+ if line.startswith("#"): continue
+ if line == "": continue
+
+ lineparts = line.split()
+ if lineparts[0].startswith("debian/tmp"):
+ pattern = lineparts[0][ len("debian/tmp"): ]
+ if len(lineparts) == 2:
+ if not pattern.startswith(lineparts[1]):
+ print >>sys.stderr, "Warning: Apparently I don't fully understand the format in file %s" % filename
+ elif len(lineparts) > 2:
+ print >>sys.stderr, "Warning: Apparently I don't fully understand the format in file %s" % filename
+
+ contents.append( pattern )
+ else:
+ print >>sys.stderr, "Note: Ignoring %s in %s" % (lineparts, filename)
+
+ paths[ filename[ :-len(".install") ] ] = contents
+
+ return paths
+
+def collect_packages(paths):
+ # These packages should be populated first (e.g. because their files will otherwise end up
+ # in other packages)
+ PACKAGES_FIRST = ("mono-jit", "mono-gac", "mono-mjs", "mono-gmcs", "mono-utils", "mono-doc")
+ # These should be populated last (because their spec is very broad)
+ PACKAGES_LAST = ("mono-mcs", "libmono-system1.0-cil", "libmono-system2.0-cil", "libmono1.0-cil", "libmono2.0-cil")
+ first = []
+ last = []
+ packages = paths.keys()
+ for packagename in PACKAGES_FIRST + PACKAGES_LAST:
+ if packagename in packages:
+ packages.remove(packagename)
+ if packagename in PACKAGES_FIRST:
+ first.append(packagename)
+ else:
+ last.append(packagename)
+ packagenames = first + packages + last
+
+ return packagenames, paths
+
+def debugify(packagenames, paths):
+ pnames = []
+ for pkg in packagenames:
+ if not pkg.endswith("-dbg"):
+ result = []
+ for path in paths[pkg]:
+ if not path.endswith("*"):
+ result.append(path + "*.mdb")
+ result.append(path + "*/*.mdb")
+ else:
+ result.append(path + ".mdb")
+ result.append(path + "/*.mdb")
+ if path.endswith("/"):
+ result.append(path + ".debug/")
+ result.append(path + "../.debug/")
+ paths[pkg + "-dbg"] = result
+ pnames.append(pkg + "-dbg")
+ pnames.append(pkg)
+ return pnames, paths
+
+if __name__ == "__main__":
+ packagenames, paths = collect_packages( collect_paths(".") )
+ packagenames, paths = debugify(packagenames, paths)
+
+ print "# This is a generated file, please do not edit directly"
+ print "# Use collect-files.py instead. -- Henryk <henryk@openmoko.org>"
+
+ packages = []
+ for pkg in packagenames:
+ if not paths[pkg]: continue
+
+ print 'FILES_%s = "%s"' % (pkg, " \\\n\t".join(paths[pkg]))
+ packages.append(pkg)
+
+ print
+ print 'PACKAGES = "%s"' % (" \\\n\t".join(packages))
diff --git a/contrib/mtn2git/.mtn2git_empty b/contrib/mtn2git/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/contrib/mtn2git/.mtn2git_empty
diff --git a/contrib/mtn2git/git2mtn.py b/contrib/mtn2git/git2mtn.py
new file mode 100755
index 0000000000..99681a9ca2
--- /dev/null
+++ b/contrib/mtn2git/git2mtn.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+
+"""
+ Copyright (C) 2006, 2007 Holger Hans Peter Freyther
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+"""
+
+#############
+#
+# Use: This tool can merge one git-branch back to one branch in monotone
+#
+# Discussion:
+# Merging from git to a monotone branch. Currently I see two modes which
+# should be supported.
+#
+# a) linear development. Only a couple of changes are done on top of the
+# branch and nothing get merged. In this case we can merge everything
+# back and each rev gets a cert with the branch.
+# This should be possible using programs like git-rebase.
+# b) we have merges inside our git-rev-list history. This means we need to
+# merge every revision and can't attach any branch certs to the revision.
+# And once we are done with this we will create a propagate like commit
+# entry and we can give that new revision a cert with the branch name.
+#
+# This means working in git is treated like a branch!
+#
+# One difficulty is with git. This propagate like commit will create a new revision
+# in monotone but none in git as both trees/manifests are the same. So what we have
+# to make sure is to use the latest mtn revision for a given mark/git revision. This
+# is where mtn2git.py needs to help. We will save a list of mtn revisions that have the
+# same git version and then will read every of them and check the branch certs and will
+# use the one matching our target branch!
+#############
diff --git a/contrib/mtn2git/mtn/.mtn2git_empty b/contrib/mtn2git/mtn/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/contrib/mtn2git/mtn/.mtn2git_empty
diff --git a/contrib/mtn2git/mtn/__init__.py b/contrib/mtn2git/mtn/__init__.py
new file mode 100644
index 0000000000..e7424ccd3d
--- /dev/null
+++ b/contrib/mtn2git/mtn/__init__.py
@@ -0,0 +1,6 @@
+from mtn import Automate, Operations
+
+__all__ = [
+ "Automate",
+ "Operations"
+ ]
diff --git a/contrib/mtn2git/mtn/authors.py b/contrib/mtn2git/mtn/authors.py
new file mode 100644
index 0000000000..90542a02da
--- /dev/null
+++ b/contrib/mtn2git/mtn/authors.py
@@ -0,0 +1,11 @@
+authors='''Authors:
+Grahame Bowland <grahame@angrygoats.net>
+
+Contributors:
+Matt Johnston <matt@ucc.asn.au>
+Nathaniel Smith <njs@pobox.com>
+Bruce Stephens <monotone@cenderis.demon.co.uk>
+Lapo Luchini <lapo@lapo.it>
+David Reiss <davidn@gmail.com>
+
+'''
diff --git a/contrib/mtn2git/mtn/common.py b/contrib/mtn2git/mtn/common.py
new file mode 100644
index 0000000000..1bbf6031c9
--- /dev/null
+++ b/contrib/mtn2git/mtn/common.py
@@ -0,0 +1,49 @@
+
+import datetime
+import time
+import fcntl
+import os
+import signal
+import traceback
+import sys
+
+def parse_timecert(value):
+ return apply(datetime.datetime, time.strptime(value, "%Y-%m-%dT%H:%M:%S")[:6])
+
+def set_nonblocking(fd):
+ fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NDELAY)
+
+def terminate_popen3(process):
+ print >> sys.stderr, ("[%s] stopping process: %s" % (os.getpid(), process.pid))
+ try:
+ process.tochild.close()
+ process.fromchild.close()
+ process.childerr.close()
+ if process.poll() == -1:
+ # the process is still running, so kill it.
+ os.kill(process.pid, signal.SIGKILL)
+ process.wait()
+ except:
+ print >> sys.stderr, ("%s failed_to_stop %s (%s)" % (os.getpid(), process.pid, traceback.format_exc()))
+
+def ago(event):
+ def plural(v, singular, plural):
+ if v == 1:
+ return "%d %s" % (v, singular)
+ else:
+ return "%d %s" % (v, plural)
+ now = datetime.datetime.utcnow()
+ ago = now - event
+ if ago.days > 0:
+ rv = "%s" % (plural(ago.days, "day", "days"))
+ elif ago.seconds > 3600:
+ hours = ago.seconds / 3600
+ minutes = (ago.seconds - (hours * 3600)) / 60
+ rv = "%s" % (plural(hours, "hour", "hours"))
+ else:
+ minutes = ago.seconds / 60
+ seconds = (ago.seconds - (minutes * 60))
+ rv = "%s" % (plural(minutes, "minute", "minutes"))
+ return rv
+
diff --git a/contrib/mtn2git/mtn/genproxy.py b/contrib/mtn2git/mtn/genproxy.py
new file mode 100755
index 0000000000..5ba67eefd6
--- /dev/null
+++ b/contrib/mtn2git/mtn/genproxy.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+class GeneratorProxy(object):
+ def __init__(self, generator):
+ self.generator = generator
+ def __iter__(self):
+ return self
+ def next(self):
+ return self.generator.next()
+
+class Seedy(GeneratorProxy):
+ def __del__(self):
+ print "testing"
+
+def test():
+ yield 2
+ yield 3
+ yield 4
+
+if __name__ == '__main__':
+ a = test()
+ b = Seedy(test())
+ for i in b:
+ print i
+ \ No newline at end of file
diff --git a/contrib/mtn2git/mtn/mtn.py b/contrib/mtn2git/mtn/mtn.py
new file mode 100644
index 0000000000..aa086d78d4
--- /dev/null
+++ b/contrib/mtn2git/mtn/mtn.py
@@ -0,0 +1,419 @@
+
+import os
+import re
+import fcntl
+import pipes
+import select
+import threading
+import popen2
+from common import set_nonblocking, terminate_popen3
+from traceback import format_exc
+import genproxy
+import sys
+
+# regular expressions that are of general use when
+# validating monotone output
+def group_compile(r):
+ return re.compile('('+r+')')
+
+hex_re = r'[A-Fa-f0-9]*'
+hex_re_c = group_compile(hex_re)
+revision_re = r'[A-Fa-f0-9]{40}'
+revision_re_c = group_compile(revision_re)
+name_re = r'^[\S]+'
+name_re_c = group_compile(name_re)
+
+class MonotoneException(Exception):
+ pass
+
+class Revision(str):
+ def __init__(self, v):
+ # special case that must be handled: empty (initial) revision ID ''
+ str.__init__(v)
+ self.obj_type = "revision"
+ if v != '' and not revision_re_c.match(self):
+ raise MonotoneException("Not a valid revision ID: %s" % (v))
+ def abbrev(self):
+ return '[' + self[:8] + '..]'
+
+class Author(str):
+ def __init__(self, v):
+ str.__init__(v)
+ self.obj_type = "author"
+
+class Runner:
+ def __init__(self, monotone, database):
+ self.base_command = [monotone, "--db=%s" % pipes.quote(database)]
+
+packet_header_re = re.compile(r'^(\d+):(\d+):([lm]):(\d+):')
+
+class Automate(Runner):
+ """Runs commands via a particular monotone process. This
+ process is started the first time run() is called, and
+ stopped when this class instance is deleted or the stop()
+ method is called.
+
+ If an error occurs, the monotone process may need to be
+ stopped and a new one created.
+ """
+ def __init__(self, *args, **kwargs):
+ Runner.__init__(*[self] + list(args), **kwargs)
+ self.lock = threading.Lock()
+ self.process = None
+
+ def stop(self):
+ if not self.process:
+ return
+ terminate_popen3(self.process)
+ self.process = None
+
+ def __process_required(self):
+ if self.process != None:
+ return
+ to_run = self.base_command + ['automate', 'stdio']
+ self.process = popen2.Popen3(to_run, capturestderr=True)
+ # breaks down with toposort and a lot of input
+ #map (set_nonblocking, [ self.process.fromchild,
+ # self.process.tochild,
+ # self.process.childerr ])
+ map (set_nonblocking, [ self.process.fromchild,
+ self.process.childerr ])
+
+ def run(self, *args, **kwargs):
+ print >> sys.stderr, (("automate is running:", args, kwargs))
+
+ lock = self.lock
+ stop = self.stop
+ class CleanRequest(genproxy.GeneratorProxy):
+ def __init__(self, *args, **kwargs):
+ genproxy.GeneratorProxy.__init__(self, *args, **kwargs)
+
+ # nb; this used to be False, but True seems to behave more sensibly.
+ # in particular, if someone holds down Refresh sometimes the code
+ # gets here before __del__ is called on the previous iterator,
+ # causing a pointless error to occur
+ if not lock.acquire(True):
+ # I've checked; this exception does _not_ cause __del__ to run, so
+ # we don't accidentally unlock a lock below
+ raise MonotoneException("Automate request cannot be called: it is already locked! This indicates a logic error in ViewMTN; please report.")
+
+ def __del__(self):
+ def read_any_unread_output():
+ try:
+ # this'll raise StopIteration if we're done
+ self.next()
+ # okay, we're not done..
+ print >> sys.stderr, ("warning: Automate output not completely read; reading manually.")
+ for stanza in self:
+ pass
+ except StopIteration:
+ pass
+
+ try:
+ read_any_unread_output()
+ lock.release()
+ except:
+ print >> sys.stderr, ("exception cleaning up after Automation; calling stop()!")
+ stop()
+
+ return CleanRequest(self.__run(*args, **kwargs))
+
+ def __run(self, command, args):
+ enc = "l%d:%s" % (len(command), command)
+ enc += ''.join(["%d:%s" % (len(x), x) for x in args]) + 'e'
+
+ # number of tries to get a working mtn going..
+ for i in xrange(2):
+ self.__process_required()
+ try:
+ self.process.tochild.write(enc)
+ self.process.tochild.flush()
+ break
+ except:
+ # mtn has died underneath the automate; restart it
+ print >> sys.stderr, ("exception writing to child process; attempting restart: %s" % format_exc())
+ self.stop()
+
+ import sys
+ def read_result_packets():
+ buffer = ""
+ while True:
+ r_stdin, r_stdout, r_stderr = select.select([self.process.fromchild], [], [], None)
+ if not r_stdin and not r_stdout and not r_stderr:
+ break
+
+ if self.process.fromchild in r_stdin:
+ data = self.process.fromchild.read()
+ if data == "":
+ break
+ buffer += data
+
+ # loop, trying to get complete packets out of our buffer
+ complete, in_packet = False, False
+ while not complete and buffer != '':
+ if not in_packet:
+ m = packet_header_re.match(buffer)
+ if not m:
+ break
+ in_packet = True
+ cmdnum, errnum, pstate, length = m.groups()
+ errnum = int(errnum)
+ length = int(length)
+ header_length = m.end(m.lastindex) + 1 # the '1' is the colon
+
+ if len(buffer) < length + header_length:
+ # not enough data read from client yet; go round
+ break
+ else:
+ result = buffer[header_length:header_length+length]
+ buffer = buffer[header_length+length:]
+ complete = pstate == 'l'
+ in_packet = False
+ yield errnum, complete, result
+
+ if complete:
+ break
+
+ # get our response, and yield() it back one line at a time
+ code_max = -1
+ data_buf = ''
+ for code, is_last, data in read_result_packets():
+ if code and code > code_max:
+ code_max = code
+ data_buf += data
+ while True:
+ nl_idx = data_buf.find('\n')
+ if nl_idx == -1:
+ break
+ yield data_buf[:nl_idx+1]
+ data_buf = data_buf[nl_idx+1:]
+ # left over data?
+ if data_buf:
+ yield data_buf
+ if code_max > 0:
+ raise MonotoneException("error code %d in automate packet." % (code_max))
+
+class Standalone(Runner):
+ """Runs commands by running monotone. One monotone process
+ per command"""
+
+ def run(self, command, args):
+ # as we pass popen3 as sequence, it executes monotone with these
+ # arguments - and does not pass them through the shell according
+ # to help(os.popen3)
+# print(("standalone is running:", command, args))
+ to_run = self.base_command + [command] + args
+ process = popen2.Popen3(to_run, capturestderr=True)
+ for line in process.fromchild:
+ yield line
+ stderr_data = process.childerr.read()
+ if len(stderr_data) > 0:
+ raise MonotoneException("data on stderr for command '%s': %s" % (command,
+ stderr_data))
+ terminate_popen3(process)
+
+class MtnObject:
+ def __init__(self, obj_type):
+ self.obj_type = obj_type
+
+class Tag(MtnObject):
+ def __init__(self, name, revision, author, branches):
+ MtnObject.__init__(self, "tag")
+ self.name, self.revision, self.author, self.branches = name, Revision(revision), author, branches
+
+class Branch(MtnObject):
+ def __init__(self, name):
+ MtnObject.__init__(self, "branch")
+ self.name = name
+
+class File(MtnObject):
+ def __init__(self, name, in_revision):
+ MtnObject.__init__(self, "file")
+ self.name = name
+ self.in_revision = in_revision
+
+class Dir(MtnObject):
+ def __init__(self, name, in_revision):
+ MtnObject.__init__(self, "dir")
+ self.name = name
+ self.in_revision = in_revision
+
+basic_io_name_tok = re.compile(r'^(\S+)')
+
+def basic_io_from_stream(gen):
+ # all of these x_consume functions return parsed string
+ # token to add to stanza, name of next consume function to call
+ # new value of line (eg. with consumed tokens removed)
+
+ def hex_consume(line):
+ m = hex_re_c.match(line[1:])
+ if line[0] != '[' or not m:
+ raise MonotoneException("This is not a hex token: %s" % line)
+ end_of_match = m.end(m.lastindex)
+ if line[end_of_match+1] != ']':
+ raise MonotoneException("Hex token ends in character other than ']': %s" % line)
+ return Revision(m.groups()[0]), choose_consume, line[end_of_match+2:]
+
+ def name_consume(line):
+ m = name_re_c.match(line)
+ if not m:
+ raise MonotoneException("Not a name: %s" % line)
+ end_of_match = m.end(m.lastindex)
+ return m.groups()[0], choose_consume, line[end_of_match:]
+
+ def choose_consume(line):
+ line = line.lstrip()
+ if line == '':
+ consumer = choose_consume
+ elif line[0] == '[':
+ consumer = hex_consume
+ elif line[0] == '"':
+ consumer = string_consume
+ else:
+ consumer = name_consume
+ return None, consumer, line
+
+ class StringState:
+ def __init__(self):
+ self.in_escape = False
+ self.has_started = False
+ self.has_ended = False
+ self.value = ''
+
+ def string_consume(line, state=None):
+ if not state:
+ state = StringState()
+
+ if not state.has_started:
+ if line[0] != '"':
+ raise MonotoneException("Not a string: %s" % line)
+ line = line[1:]
+ state.has_started = True
+
+ idx = 0
+ for idx, c in enumerate(line):
+ if state.in_escape:
+ if c != '\\' and c != '"':
+ raise MonotoneException("Invalid escape code: %s in %s\n" % (c, line))
+ state.value += c
+ state.in_escape = False
+ else:
+ if c == '\\':
+ state.in_escape = True
+ elif c == '"':
+ state.has_ended = True
+ break
+ else:
+ state.value += c
+
+ if state.has_ended:
+ return state.value, choose_consume, line[idx+1:]
+ else:
+ return (None,
+ lambda s: string_consume(s, state),
+ line[idx+1:])
+
+ consumer = choose_consume
+ current_stanza = []
+ for line in gen:
+ # if we're not in an actual consumer (which we shouldn't be, unless
+ # we're parsing some sort of multi-line token) and we have a blank
+ # line, it indicates the end of any current stanza
+ if (consumer == choose_consume) and (line == '' or line == '\n') and current_stanza:
+ yield current_stanza
+ current_stanza = []
+ continue
+
+ while line != '' and line != '\n':
+ new_token, consumer, line = consumer(line)
+ if new_token != None:
+ current_stanza.append(new_token)
+ if current_stanza:
+ yield current_stanza
+
+class Operations:
+ def __init__(self, runner_args):
+ self.standalone = apply(Standalone, runner_args)
+ self.automate = apply(Automate, runner_args)
+
+ def tags(self):
+ for stanza in basic_io_from_stream(self.automate.run('tags', [])):
+ if stanza[0] == 'tag':
+ branches = []
+ for branch in stanza[7:]:
+ branches.append(Branch(branch))
+ yield Tag(stanza[1], stanza[3], stanza[5], branches)
+
+ def branches(self):
+ for line in (t.strip() for t in self.automate.run('branches', [])):
+ if not line:
+ continue
+ yield apply(Branch, (line,))
+
+ def graph(self):
+ for line in self.automate.run('graph', []):
+ yield line
+
+ def parents(self, revision):
+ if revision != "":
+ for line in (t.strip() for t in self.automate.run('parents', [revision])):
+ if not line:
+ continue
+ yield apply(Revision, (line,))
+
+ def ancestry_difference(self, new_rev, old_revs):
+ """
+ new_rev a single new revision number
+ old_revs a list of revisions
+ """
+ if new_rev != "":
+ for line in (t.strip() for t in self.automate.run('ancestry_difference', [new_rev]+old_revs)):
+ if not line:
+ continue
+ yield apply(Revision, (line,))
+
+ def children(self, revision):
+ if revision != "":
+ for line in (t.strip() for t in self.automate.run('children', [revision])):
+ if not line:
+ continue
+ yield apply(Revision, (line,))
+
+ def toposort(self, revisions):
+ for line in (t.strip() for t in self.automate.run('toposort', revisions)):
+ if not line:
+ continue
+ yield apply(Revision, (line,))
+
+ def heads(self, branch):
+ for line in (t.strip() for t in self.automate.run('heads', [branch])):
+ if not line:
+ continue
+ yield apply(Revision, (line,))
+
+ def get_content_changed(self, revision, path):
+ for stanza in basic_io_from_stream(self.automate.run('get_content_changed', [revision, path])):
+ yield stanza
+
+ def get_revision(self, revision):
+ for stanza in basic_io_from_stream(self.automate.run('get_revision', [revision])):
+ yield stanza
+
+ def get_manifest_of(self, revision):
+ for stanza in basic_io_from_stream(self.automate.run('get_manifest_of', [revision])):
+ yield stanza
+
+ def get_file(self, fileid):
+ for stanza in self.automate.run('get_file', [fileid]):
+ yield stanza
+
+ def certs(self, revision):
+ for stanza in basic_io_from_stream(self.automate.run('certs', [revision])):
+ yield stanza
+
+ def diff(self, revision_from, revision_to, files=[]):
+ args = ['-r', revision_from, '-r', revision_to] + files
+ for line in self.standalone.run('diff', args):
+ yield line
+
+
diff --git a/contrib/mtn2git/mtn/utility.py b/contrib/mtn2git/mtn/utility.py
new file mode 100644
index 0000000000..c7345c5d1e
--- /dev/null
+++ b/contrib/mtn2git/mtn/utility.py
@@ -0,0 +1,100 @@
+
+import popen2
+import select
+import fcntl
+import os
+
+def set_nonblocking(fd):
+ fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NDELAY)
+
+def run_command(command, timeout=None, to_child=None):
+ "returns a tuple of (was_timeout, exit_code, data_read)"
+ p = popen2.Popen3(command, capturestderr=True)
+ set_nonblocking(p.fromchild)
+ set_nonblocking(p.childerr)
+ fromchild_read = ""
+ childerr_read = ""
+ was_timeout = False
+ if to_child != None:
+ p.tochild.write(to_child)
+ p.tochild.close()
+ while 1:
+ ro, rw, re = select.select([p.fromchild], [], [p.childerr], timeout)
+ if not ro and not rw and not re:
+ was_timeout = True
+ break
+ if p.fromchild in ro:
+ recv = p.fromchild.read()
+ if recv == "": break
+ fromchild_read += recv
+ if p.childerr in re:
+ recv = p.childerr.read()
+ if recv == "": break
+ childerr_read += recv
+ if not was_timeout:
+ # check for any data we might have missed (due to a premature break)
+ # (if there isn't anything we just get a IOError, which we don't mind
+ try: fromchild_read += p.fromchild.read()
+ except IOError: pass
+ try: childerr_read += p.childerr.read()
+ except IOError: pass
+ p.fromchild.close()
+ # if there wasn't a timeout, the program should have exited; in which case we should wait() for it
+ # otherwise, it might be hung, so the parent should wait for it.
+ # (wrap in a try: except: just in case some other thread happens to wait() and grab ours; god wrapping
+ # python around UNIX is horrible sometimes)
+ exitcode = None
+ try:
+ if not was_timeout: exitcode = p.wait() >> 8
+ except: pass
+ return { 'run_command' : command,
+ 'timeout' : was_timeout,
+ 'exitcode' : exitcode,
+ 'fromchild' : fromchild_read,
+ 'childerr' : childerr_read }
+
+def iter_command(command, timeout=None):
+ p = popen2.Popen3(command, capturestderr=True)
+ set_nonblocking(p.fromchild)
+ set_nonblocking(p.childerr)
+ fromchild_read = ""
+ childerr_read = ""
+ was_timeout = False
+ while 1:
+ ro, rw, re = select.select([p.fromchild], [], [p.childerr], timeout)
+ if not ro and not rw and not re:
+ was_timeout = True
+ break
+ if p.fromchild in ro:
+ recv = p.fromchild.read()
+ if recv == "": break
+ fromchild_read += recv
+ while 1:
+ nl = fromchild_read.find('\n')
+ if nl == -1: break
+ yield fromchild_read[:nl]
+ fromchild_read = fromchild_read[nl+1:]
+ if p.childerr in re:
+ recv = p.childerr.read()
+ if recv == "": break
+ childerr_read += recv
+ if not was_timeout:
+ # check for any data we might have missed (due to a premature break)
+ # (if there isn't anything we just get a IOError, which we don't mind
+ try: fromchild_read += p.fromchild.read()
+ except IOError: pass
+ try: childerr_read += p.childerr.read()
+ except IOError: pass
+ p.fromchild.close()
+ p.tochild.close()
+ # yield anything left over
+ to_yield = fromchild_read.split('\n')
+ while len(to_yield): yield to_yield.pop()
+ # call wait()
+ try:
+ if not was_timeout: p.wait()
+ except: pass
+ if len(childerr_read): raise Exception("data on stderr (command is %s)" % command, childerr_read)
+ if was_timeout: raise Exception("command timeout")
+
diff --git a/contrib/mtn2git/mtn2git.py b/contrib/mtn2git/mtn2git.py
new file mode 100755
index 0000000000..cda4f39fca
--- /dev/null
+++ b/contrib/mtn2git/mtn2git.py
@@ -0,0 +1,610 @@
+#!/usr/bin/env python
+
+"""
+ Copyright (C) 2006, 2007 Holger Hans Peter Freyther
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+"""
+
+####
+# TODO:
+# -tag handling
+# -work with n-merges
+#
+# DISCUSSION:
+# -For some reason the get_revision information might be inaccurate
+# and I should consider just comparing the manifests.
+# I would use the manifests of the parents and consider all files deleted
+# and then remove every dir/file that is inside the new manifest from this
+# list.
+# Benefits:
+# - 1:1 match of the manifest regardles of get_revision information
+# - Renaming is handled by git anyway
+# Downsides:
+# - The size of the import will grow.
+#
+
+import mtn
+import os
+import sys
+import datetime
+import email.Utils
+
+import status
+
+
+def get_mark(revision):
+ """
+ Get a mark for a specific revision. If the revision is known the former
+ mark will be returned. Otherwise a new mark will be allocated and stored
+ to the mark file.
+ """
+ if revision in status.marks:
+ return status.marks[revision]
+ status.last_mark += 1
+ status.marks[revision] = status.last_mark
+ print >> status.mark_file, "%d: %s" % (status.last_mark, revision)
+ return status.last_mark
+
+def has_mark(revision):
+ return revision in status.marks
+
+
+def mark_empty_revision(revision, parent):
+ """Git does not like empty merges, just skip the revision"""
+ # TODO, FIXME, XXX, We might want to add a reset cmd here
+ print >> sys.stderr, "Found an empty revision, skipping '%s'" % revision
+ parent_mark = status.marks[parent]
+ status.marks[revision] = parent_mark
+
+ # There is another mtn revision that is using this mark!
+ if not parent_mark in status.same_revisions:
+ status.same_revisions[parent_mark] = []
+ status.same_revisions[parent_mark].append(revision)
+
+
+def get_branch_name(revision):
+ """
+ TODO for unnamed branches (e.g. as we lack the certs) we might want to follow
+ the parents until we end up at a item with a branch name and then use the last
+ item without a name...
+ """
+ if "branch" in revision:
+ branch = revision["branch"]
+ else:
+ #branch = "initial-%s" % revision["revision"]
+ branch = "mtn-unnamed-branch"
+ return branch
+
+def reset_git(ops, revision):
+ """
+ Find the name of the branch of this revision
+ """
+ branch = get_branch_name(revision)
+
+ cmd = []
+ cmd += ["reset refs/heads/%s" % branch]
+ cmd += ["from :%s" % get_mark(revision["revision"])]
+ cmd += [""]
+ print "\n".join(cmd)
+
+def filter_renamed(manifest, renamed):
+ """
+ If we base from a revision that has already done
+ the move, git-fast-import will complain that the file
+ has been already moved
+ """
+ if len(renamed) == 0:
+ return renamed
+
+ for line in manifest:
+ if line[0] == "file":
+ renamed = filter(lambda (to,from_,manifest): to != line[1], renamed)
+
+ return renamed
+
+def get_git_date(revision):
+ """
+ Convert the "date" cert of monotone to a time understandable by git. No timezone
+ conversions are done.
+ """
+ dt = datetime.datetime.strptime(revision["date"], "%Y-%m-%dT%H:%M:%S").strftime("%a, %d %b %Y %H:%M:%S +0000")
+ return dt
+
+def recursively_delete(ops, manifest, revision, dir_name, to_delete):
+ """
+ Recursively delete all files that dir_name inside the name
+ """
+ for line in manifest:
+ if line[0] == "dir" or line[0] == "file":
+ if line[1].startswith(dir_name):
+ print >> sys.stderr, "Deleting '%s'" % line[1]
+ to_delete.add((line[1], revision))
+ elif line[0] in ["format_version"]:
+ assert(line[1] == "1")
+ else:
+ print >> sys.stderr, line[0]
+ assert(False)
+
+ return to_delete
+
+def recursively_rename(ops, manifest, revision, old_name, new_name, to_add_dirs, to_add_files, to_remove_items, files_deleted, files_sticky):
+ """
+ mtn has a rename command and can rename entrie directories. For git we will have to do the recursive renaming
+ ourselves. Basicly we will get all files and replace old_name with new_name but only:
+
+ If the file of the old_manifest is not in our to be deleted list
+ """
+ old_dir = old_name + "/"
+ for line in manifest:
+ if line[1].startswith(old_dir) or line[1] == old_name:
+ already_handled = False
+ for (deleted,_) in files_deleted:
+ if line[1] == deleted:
+ already_handled = True
+ break
+
+ # Don't rename files that should be in the same directory
+ if line[1] in files_sticky:
+ already_handled = True
+
+ if already_handled:
+ pass
+ elif line[0] == "file":
+ print >> sys.stderr, "Will add '%s' old: '%s' new: '%s' => result: '%s'" % (line[1], old_name, new_name, line[1].replace(old_name, new_name, 1))
+ to_add_files.add((line[1].replace(old_name, new_name, 1), None, revision))
+ elif line[0] == "dir":
+ to_add_dirs.add((line[1].replace(old_name, new_name, 1), revision))
+ elif line[0] in ["format_version"]:
+ assert(line[1] == "1")
+ else:
+ print >> sys.stderr, line[0]
+ assert(False)
+
+ return (to_add_files, to_add_dirs)
+
+#
+# We need to recursively rename the directories. Now the difficult part is to undo certain operations.
+#
+# e.g we rename the whole dir and then rename a file back. We could revive a directory that was marked
+# for deletion.
+#
+# rename "weird/two/three"
+# to "unweird/four"
+#
+# rename "weird/two/three/four"
+# to "weird/two/three"
+#
+# Here we would schedule weird/two/three for deletion but then revive it again. So three does not
+# get copied to unweird/four/three
+# """
+def recursively_rename_directories(ops, manifests, rename_commands, files_deleted, files_moved_sticky):
+ to_add_directories = set()
+ to_add_files = set()
+ to_remove_items = set()
+
+ for (old_name, new_name, old_revision) in rename_commands:
+ # Check if we have the above case and rename a more specific directory
+ # and then we will alter the result...
+ inner_rename = False
+ for (other_old_name, other_new_name, other_rev) in rename_commands:
+ if old_name.startswith(other_old_name + "/") and other_old_name != old_name:
+ inner_rename = True
+ print >> sys.stderr, "Inner rename detected", old_name, other_old_name
+ # Fixup the renaming
+ def rename(filename, filerev, rev, would_be_new_name):
+ if filename.startswith(would_be_new_name + "/"):
+ return filename.replace(would_be_new_name, new_name, 1), filerev, rev
+ return filename, filerev, rev
+
+ would_be_new_name = other_new_name + "/" + old_name[len(other_old_name)+1:]
+ to_remove_items = set(filter(lambda (item,_): item != new_name, to_remove_items))
+ to_add_directories = set(filter(lambda (item,_): item != would_be_new_name, to_add_directories))
+ to_add_directories.add((new_name, old_revision))
+ to_add_files = set(map(lambda (fn, fr, r): rename(fn, fr, r, would_be_new_name), to_add_files))
+
+ if not inner_rename:
+ to_remove_items.add((old_name, old_revision))
+ recursively_delete(ops, manifests[old_revision], old_revision, old_name + "/", to_remove_items)
+ recursively_rename(ops, manifests[old_revision], old_revision, old_name, new_name, to_add_directories, to_add_files, to_remove_items, files_deleted, files_moved_sticky)
+
+ return (to_add_directories, to_add_files, to_remove_items)
+
+
+def build_tree(manifest):
+ dirs = {}
+ files = {}
+ for line in manifest:
+ if line[0] == "file":
+ files[line[1]] = (line[3],line[4:])
+ elif line[0] == "dir":
+ dirs[line[1]] = 1
+ elif line[0] != "format_version":
+ print >> sys.stderr, line[0]
+ assert(False)
+ return (dirs,files)
+
+def compare_with_manifest(all_added, all_modified, all_deleted, new_manifest, old_manifests):
+ """
+ Sanity check that the difference between the old and the new manifest is the one
+ we have in all_added, all_modified, all_deleted
+ """
+ old_trees = {}
+ really_added = {}
+ really_modified = {}
+ really_removed = {}
+
+ current_dirs, current_files = build_tree(new_manifest)
+
+ for parent in old_manifests.keys():
+ old_trees[parent] = build_tree(old_manifests[parent])
+
+ print >> sys.stderr, len(old_manifests)
+
+def fast_import(ops, revision):
+ """Import a revision into git using git-fast-import.
+
+ First convert the revision to something git-fast-import
+ can understand
+ """
+ assert("revision" in revision)
+ assert("author" in revision)
+ assert("committer" in revision)
+ assert("parent" in revision)
+
+
+ branch = get_branch_name(revision)
+
+ # Okay: We sometimes have merged where the old manifest is the new one
+ # I have no idea how this can happen but there are at least two examples in the
+ # net.venge.monotone history.
+ # The problem ist git-fast-import will not let us create the same manifest again.
+ # So if we are in a merge, propagation and the old manifest is the new one we will
+ # do a git-reset.
+ # Examples in the mtn history: 6dc36d2cba722f500c06f33e225367461059d90e, dc661f0c25ee96a5a5cf5b5b60deafdf8ccaf286
+ # and 7b8331681bf77cd8329662dbffed0311765e7547, 13b1a1e617a362c5735002937fead98d788737f7
+ # aa05aa9171bac92766b769bbb703287f53e08693 is a merge of the same manifest...
+ # so we will just go with one of the two revisions..
+ # We will have the same manifest if we propagate something from one branch to another. git does
+ # not have a special revision showing that copy but will only change the head.
+ # We will do the same and reset the branch to this revision.
+ for parent in revision["parent"]:
+ manifest_version = parse_revision(ops, parent)["manifest"]
+ if manifest_version == revision["manifest"]:
+ mark_empty_revision(revision["revision"], parent)
+ reset_git(ops, revision)
+ return
+
+ # Use the manifest to find dirs and files
+ manifest = [line for line in ops.get_manifest_of(revision["revision"])]
+ manifests = {}
+ dirs = {}
+ for parent in revision["parent"]:
+ manifests[parent] = [line for line in ops.get_manifest_of(parent)]
+ for line in manifests[parent]:
+ if line[0] == "dir":
+ if not parent in dirs:
+ dirs[parent] = {}
+ dirs[parent][line[1]] = 1
+
+ # We can not just change the mode of a file but we need to modifiy the whole file. We
+ # will simply add it to the modified list and ask to retrieve the status from the manifest
+ for (file, attribute, value, rev) in revision["set_attributes"]:
+ if attribute == "mtn:execute":
+ revision["modified"].append((file, None, rev))
+ for (file, attribute, rev) in revision["clear_attributes"]:
+ if attribute == "mtn:execute":
+ revision["modified"].append((file, None, rev))
+
+
+
+ cmd = []
+ cmd += ["commit refs/heads/%s" % branch]
+ cmd += ["mark :%s" % get_mark(revision["revision"])]
+ cmd += ["author <%s> %s" % (revision["author"], get_git_date(revision))]
+ cmd += ["committer <%s> %s" % (revision["committer"], get_git_date(revision))]
+ cmd += ["data %d" % len(revision["changelog"])]
+ cmd += ["%s" % revision["changelog"]]
+
+ # Emulation for renaming. We will split them into two lists
+ file_renamed_del = set()
+ file_renamed_new = set()
+ file_moved_sticky = set()
+
+ if len(revision["parent"]) != 0:
+ cmd += ["from :%s" % get_mark(revision["parent"][0])]
+ renamed = revision["renamed"]
+
+ to_rename_directories = []
+ for (new_name, old_name, old_revision) in renamed:
+ # 24cba5923360fef7c5cc81d51000e30b90355eb9 is a rev where src == dest but the
+ # directory got renamed, so this means this file got added to the new directory
+ # TODO, XXX, FIXME check if this can be done for directories as well
+ if new_name == old_name and not old_name in dirs[old_revision]:
+ print >> sys.stderr, "Bogus rename in %s (%s, %s)?" % (revision["revision"], new_name, old_name)
+ file_moved_sticky.add(old_name)
+
+ # Check if the old_name was a directory in the old manifest
+ # If we rename a directory we will need to recursively remove and recursively
+ # add...
+ # Add the '/' otherwise we might rename the wrong directory which shares the
+ # same prefix.
+ # fca159c5c00ae4158c289f5aabce995378d4e41b is quite funny. It renames a directory
+ # and then renames another directory within the renamed one and in the worse case
+ # we will revive a deleted directory, file...
+ elif old_name in dirs[old_revision]:
+ print >> sys.stderr, "Detected directory rename '%s' => '%s'" % (old_name, new_name)
+ assert(old_revision in manifests)
+ to_rename_directories.append((old_name, new_name, old_revision))
+ else:
+ print >> sys.stderr, "Renaming %s => %s" % (old_name, new_name)
+ file_renamed_new.add((new_name, None, revision["revision"]))
+ file_renamed_del.add((old_name, old_revision))
+
+ # The first parent is our from.
+ for parent in revision["parent"][1:]:
+ cmd += ["merge :%s" % get_mark(parent)]
+
+ # Do the renaming now
+ (renamed_dirs, renamed_new, renamed_old) = recursively_rename_directories(ops, manifests, to_rename_directories, file_renamed_del.union(set(revision["removed"])), file_moved_sticky)
+
+ # Sanity check, don't remove anything we modify
+ all_added = set(revision["added_dirs"]).union(renamed_dirs)
+ all_modifications = set(revision["modified"]).union(set(revision["added_files"])).union(renamed_new).union(file_renamed_new)
+ all_deleted = set(revision["removed"]).union(renamed_old).union(file_renamed_del)
+ all_deleted_new = all_deleted
+
+ # Check if we delete and add at the same time
+ for (deleted,rev) in all_deleted:
+ for (added,_) in all_added:
+ if added == deleted:
+ print >> sys.stderr, "Added and Deleted", added, deleted
+ all_deleted_new = set(filter(lambda (dele,_): dele != added, all_deleted_new))
+ assert((added,rev) not in all_deleted_new)
+
+ for (modified,_,_) in all_modifications:
+ if modified == deleted:
+ print >> sys.stderr, "Modified and Deleted", modified, deleted
+ all_deleted_new = set(filter(lambda (dele,_): dele != modified, all_deleted_new))
+ assert((modified,rev) not in all_deleted_new)
+
+ # Filtered list of to be deleted items
+ all_deleted = all_deleted_new
+
+ # Check if we delete but the manifest has a file like this
+ for line in manifest:
+ if line[0] == "dir" or line[0] == "file":
+ for (deleted,rev) in all_deleted:
+ if line[1] == deleted:
+ # 91da98265a39c93946e00adf5d7bf92b341de847 of mtn has a delete + rename
+ print >> sys.stderr, "Trying to delete a file which is in the new manifest", line[1], deleted
+ assert(False)
+
+ compare_with_manifest(all_added, all_modifications, all_deleted, manifest, manifests)
+
+ for (dir_name, rev) in all_added:
+ cmd += ["M 644 inline %s" % os.path.join(dir_name, ".mtn2git_empty")]
+ cmd += ["data <<EOF"]
+ cmd += ["EOF"]
+ cmd += [""]
+
+ for (file_name, file_revision, rev) in all_modifications:
+ (mode, file) = get_file_and_mode(ops, manifest, file_name, file_revision, revision["revision"])
+ cmd += ["M %d inline %s" % (mode, file_name)]
+ cmd += ["data %d" % len(file)]
+ cmd += ["%s" % file]
+
+ for (path, rev) in all_deleted:
+ assert(rev in dirs)
+ if path in dirs[rev]:
+ cmd += ["D %s" % os.path.join(path, ".mtn2git_empty")]
+ else:
+ cmd += ["D %s" % path]
+
+ cmd += [""]
+ print "\n".join(cmd)
+
+
+def is_trusted(operations, revision):
+ for cert in operations.certs(revision):
+ if cert[0] != 'key' or cert[3] != 'ok' or cert[8] != 'trust' or cert[9] != 'trusted':
+ print >> sys.stderr, "Cert untrusted?, this must be bad", cert
+ return False
+ return True
+
+def get_file_and_mode(operations, manifest, file_name, _file_revision, rev = None):
+ mode = 644
+
+ file_revision = None
+ for line in manifest:
+ if line[0] == "file" and line[1] == file_name:
+ assert(line[1] == file_name)
+ assert(line[2] == "content")
+
+ if _file_revision:
+ assert(line[3] == _file_revision)
+ file_revision = line[3]
+
+ attributes = line[4:]
+ assert(len(attributes) % 3 == 0)
+ if len(attributes) >= 3:
+ for i in range(0, len(attributes)%3+1):
+ if attributes[i] == "attr" and attributes[i+1] == "mtn:execute" and attributes[i+2] == "true":
+ mode = 755
+ break
+
+ assert(file_revision)
+ file = "".join([file for file in operations.get_file(file_revision)])
+ return (mode, file)
+
+ print >> sys.stderr, file_name, rev
+ assert(False)
+
+
+def parse_revision(operations, revision):
+ """
+ Parse a revision as of mtn automate get_revision
+
+ Return a tuple with the current version, a list of parents,
+ a list of operations and their revision
+ """
+ if not is_trusted(operations, revision):
+ raise Exception("Revision %s is not trusted!" % revision)
+
+ # The order of certain operations, e.g rename matter so don't use a set
+ revision_description = {}
+ revision_description["revision"] = revision
+ revision_description["added_dirs"] = []
+ revision_description["added_files"] = []
+ revision_description["removed"] = []
+ revision_description["modified"] = []
+ revision_description["renamed"] = []
+ revision_description["set_attributes"] = []
+ revision_description["clear_attributes"] = []
+
+ old_rev = None
+
+ for line in operations.get_revision(revision):
+ if line[0] == "format_version":
+ assert(line[1] == "1")
+ elif line[0] == "old_revision":
+ if not "parent" in revision_description:
+ revision_description["parent"] = []
+ if len(line[1]) != 0:
+ revision_description["parent"].append(line[1])
+ old_rev = line[1]
+ elif line[0] == "new_manifest":
+ revision_description["manifest"] = line[1]
+ elif line[0] == "rename":
+ revision_description["renamed"].append((line[3], line[1], old_rev))
+ elif line[0] == "patch":
+ revision_description["modified"].append((line[1], line[5], old_rev))
+ elif line[0] == "delete":
+ revision_description["removed"].append((line[1], old_rev))
+ elif line[0] == "add_dir":
+ revision_description["added_dirs"].append((line[1], old_rev))
+ elif line[0] == "add_file":
+ revision_description["added_files"].append((line[1], line[3], old_rev))
+ elif line[0] == "clear":
+ revision_description["clear_attributes"].append((line[1], line[3], old_rev))
+ elif line[0] == "set":
+ revision_description["set_attributes"].append((line[1], line[3], line[5], old_rev))
+ else:
+ print >> sys.stderr, line
+ assert(False)
+
+ for cert in operations.certs(revision):
+ # Known cert names used by mtn, we can ignore them as they can't be converted to git
+ if cert[5] in ["suspend", "testresult", "file-comment", "comment", "release-candidate"]:
+ pass
+ elif cert[5] in ["author", "changelog", "date", "branch", "tag"]:
+ revision_description[cert[5]] = cert[7]
+ if cert[5] == "author":
+ revision_description["committer"] = cert[1]
+ else:
+ print >> sys.stderr, "Unknown Cert: Ignoring", cert[5], cert[7]
+ assert(False)
+
+ return revision_description
+
+
+def tests(ops, revs):
+ """Load a bunch of revisions and exit"""
+ for rev in revs:
+ print >> sys.stderr, rev
+ fast_import(ops, parse_revision(ops, rev))
+
+ sys.exit()
+
+def main(mtn_cli, db, rev):
+ if not db:
+ print >> sys.stderr, "You need to specifiy a monotone db"
+ sys.exit()
+
+ ops = mtn.Operations([mtn_cli, db])
+
+ # Double rename in mtn
+ #tests(ops, ["fca159c5c00ae4158c289f5aabce995378d4e41b"])
+
+ # Rename and remove in OE
+ #tests(ops, ["74db43a4ad2bccd5f2fd59339e4ece0092f8dcb0"])
+
+ # Rename + Dele
+ #tests(ops, ["91da98265a39c93946e00adf5d7bf92b341de847"])
+
+ # Issue with renaming in OE
+ #tests(ops, ["c81294b86c62ee21791776732f72f4646f402445"])
+
+ # Unterminated inner renames
+ #tests(ops, ["d813a779ef7157f88dade0b8ccef32f28ff34a6e", "4d027b6bcd69e7eb5b64b2e720c9953d5378d845", "af5ffd789f2852e635aa4af88b56a893b7a83a79"])
+
+ # Broken rename in OE. double replacing of the directory command
+ #tests(ops, ["11f85aab185581dcbff7dce29e44f7c1f0572a27"])
+
+ if rev:
+ tests(ops, [rev])
+ sys.exit()
+
+ branches = [branch.name for branch in ops.branches()]
+ ops.automate.stop()
+
+ all_revs = []
+ for branch in branches:
+ heads = [head for head in ops.heads(branch)]
+ if branch in status.former_heads:
+ old_heads = status.former_heads[branch]
+ else:
+ old_heads = []
+
+ for head in heads:
+ all_revs += ops.ancestry_difference(head, old_heads)
+ status.former_heads[branch] = heads
+
+ sorted_revs = [rev for rev in ops.toposort(all_revs)]
+ for rev in sorted_revs:
+ if has_mark(rev):
+ print >> sys.stderr, "Already having commit '%s'" % rev
+ else:
+ print >> sys.stderr, "Going to import revision ", rev
+ fast_import(ops, parse_revision(ops, rev))
+
+
+if __name__ == "__main__":
+ import optparse
+ parser = optparse.OptionParser()
+ parser.add_option("-d", "--db", dest="database",
+ help="The monotone database to use")
+ parser.add_option("-m", "--marks", dest="marks", default="mtn2git-marks",
+ help="The marks allocated by the mtn2git command")
+ parser.add_option("-t", "--mtn", dest="mtn", default="mtn",
+ help="The name of the mtn command to use")
+ parser.add_option("-s", "--status", dest="status", default="mtn2git.status.v2",
+ help="The status file as used by %prog")
+ parser.add_option("-r", "--revision", dest="rev", default=None,
+ help="Import a single revision to help debugging.")
+
+ (options,_) = parser.parse_args(sys.argv)
+ status.mark_file = file(options.marks, "a")
+
+ try:
+ status.load(options.status)
+ except IOError:
+ print >> sys.stderr, "Failed to open the status file"
+ main(options.mtn, options.database, options.rev)
+ status.store(options.status)
diff --git a/contrib/mtn2git/status.py b/contrib/mtn2git/status.py
new file mode 100644
index 0000000000..47d06b51fd
--- /dev/null
+++ b/contrib/mtn2git/status.py
@@ -0,0 +1,47 @@
+"""
+ Copyright (C) 2006, 2007 Holger Hans Peter Freyther
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+"""
+
+import pickle
+
+marks = {}
+last_mark = 0
+mark_file = None
+former_heads = {}
+same_revisions = {}
+
+def load(status_name):
+ global marks, last_mark, mark_file, former_heads, same_revisions
+ file = open(status_name, "rb")
+ marks = pickle.load(file)
+ last_mark = pickle.load(file)
+ former_heads = pickle.load(file)
+ same_revisions = pickle.load(file)
+ file.close()
+
+def store(status_name):
+ global marks, last_mark, mark_file, former_heads, same_revisions
+ file = open(status_name, "wb")
+ pickle.dump(marks, file)
+ pickle.dump(last_mark, file)
+ pickle.dump(former_heads, file)
+ pickle.dump(same_revisions, file)
+ file.close()
diff --git a/packages/bind/bind-9.3.4-P1/.mtn2git_empty b/packages/bind/bind-9.3.4-P1/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/bind/bind-9.3.4-P1/.mtn2git_empty
diff --git a/packages/bind/bind-9.3.4-P1/conf.patch b/packages/bind/bind-9.3.4-P1/conf.patch
new file mode 100644
index 0000000000..202c5319e1
--- /dev/null
+++ b/packages/bind/bind-9.3.4-P1/conf.patch
@@ -0,0 +1,301 @@
+diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0
+--- bind-9.3.1.orig/conf/db.0 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.0 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,12 @@
++;
++; BIND reverse data file for broadcast zone
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
+diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127
+--- bind-9.3.1.orig/conf/db.127 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.127 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND reverse data file for local loopback interface
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
++1.0.0 IN PTR localhost.
+diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty
+--- bind-9.3.1.orig/conf/db.empty 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.empty 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,14 @@
++; BIND reverse data file for empty rfc1918 zone
++;
++; DO NOT EDIT THIS FILE - it is used for multiple zones.
++; Instead, copy it, edit named.conf, and use that copy.
++;
++$TTL 86400
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 86400 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
+diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local
+--- bind-9.3.1.orig/conf/db.local 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.local 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND data file for local loopback interface
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
++@ IN A 127.0.0.1
+diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root
+--- bind-9.3.1.orig/conf/db.root 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.root 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,45 @@
++
++; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
++;; global options: printcmd
++;; Got answer:
++;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
++;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
++
++;; QUESTION SECTION:
++;. IN NS
++
++;; ANSWER SECTION:
++. 518400 IN NS A.ROOT-SERVERS.NET.
++. 518400 IN NS B.ROOT-SERVERS.NET.
++. 518400 IN NS C.ROOT-SERVERS.NET.
++. 518400 IN NS D.ROOT-SERVERS.NET.
++. 518400 IN NS E.ROOT-SERVERS.NET.
++. 518400 IN NS F.ROOT-SERVERS.NET.
++. 518400 IN NS G.ROOT-SERVERS.NET.
++. 518400 IN NS H.ROOT-SERVERS.NET.
++. 518400 IN NS I.ROOT-SERVERS.NET.
++. 518400 IN NS J.ROOT-SERVERS.NET.
++. 518400 IN NS K.ROOT-SERVERS.NET.
++. 518400 IN NS L.ROOT-SERVERS.NET.
++. 518400 IN NS M.ROOT-SERVERS.NET.
++
++;; ADDITIONAL SECTION:
++A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
++B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
++C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
++D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
++E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
++F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
++G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
++H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
++I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
++J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
++K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
++L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12
++M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
++
++;; Query time: 81 msec
++;; SERVER: 198.41.0.4#53(a.root-servers.net.)
++;; WHEN: Sun Feb 1 11:27:14 2004
++;; MSG SIZE rcvd: 436
++
+diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf
+--- bind-9.3.1.orig/conf/named.conf 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf 2005-07-10 22:33:46.000000000 +0200
+@@ -0,0 +1,49 @@
++// This is the primary configuration file for the BIND DNS server named.
++//
++// If you are just adding zones, please do that in /etc/bind/named.conf.local
++
++include "/etc/bind/named.conf.options";
++
++// prime the server with knowledge of the root servers
++zone "." {
++ type hint;
++ file "/etc/bind/db.root";
++};
++
++// be authoritative for the localhost forward and reverse zones, and for
++// broadcast zones as per RFC 1912
++
++zone "localhost" {
++ type master;
++ file "/etc/bind/db.local";
++};
++
++zone "127.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.127";
++};
++
++zone "0.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.0";
++};
++
++zone "255.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.255";
++};
++
++// zone "com" { type delegation-only; };
++// zone "net" { type delegation-only; };
++
++// From the release notes:
++// Because many of our users are uncomfortable receiving undelegated answers
++// from root or top level domains, other than a few for whom that behaviour
++// has been trusted and expected for quite some length of time, we have now
++// introduced the "root-delegations-only" feature which applies delegation-only
++// logic to all top level domains, and to the root domain. An exception list
++// should be specified, including "MUSEUM" and "DE", and any other top level
++// domains from whom undelegated responses are expected and trusted.
++// root-delegation-only exclude { "DE"; "MUSEUM"; };
++
++include "/etc/bind/named.conf.local";
+diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local
+--- bind-9.3.1.orig/conf/named.conf.local 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.local 2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,8 @@
++//
++// Do any local configuration here
++//
++
++// Consider adding the 1918 zones here, if they are not used in your
++// organization
++//include "/etc/bind/zones.rfc1918";
++
+diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options
+--- bind-9.3.1.orig/conf/named.conf.options 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.options 2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,24 @@
++options {
++ directory "/var/cache/bind";
++
++ // If there is a firewall between you and nameservers you want
++ // to talk to, you might need to uncomment the query-source
++ // directive below. Previous versions of BIND always asked
++ // questions using port 53, but BIND 8.1 and later use an unprivileged
++ // port by default.
++
++ // query-source address * port 53;
++
++ // If your ISP provided one or more IP addresses for stable
++ // nameservers, you probably want to use them as forwarders.
++ // Uncomment the following block, and insert the addresses replacing
++ // the all-0's placeholder.
++
++ // forwarders {
++ // 0.0.0.0;
++ // };
++
++ auth-nxdomain no; # conform to RFC1035
++
++};
++
+diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918
+--- bind-9.3.1.orig/conf/zones.rfc1918 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/zones.rfc1918 2005-07-10 22:14:10.000000000 +0200
+@@ -0,0 +1,20 @@
++zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++
++zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++
++zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d
+--- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200
+@@ -0,0 +1,63 @@
++#!/bin/sh
++
++PATH=/sbin:/bin:/usr/sbin:/usr/bin
++
++# for a chrooted server: "-u bind -t /var/lib/named"
++# Don't modify this line, change or create /etc/default/bind9.
++OPTIONS=""
++
++test -f /etc/default/bind9 && . /etc/default/bind9
++
++test -x /usr/sbin/rndc || exit 0
++
++case "$1" in
++ start)
++ echo -n "Starting domain name service: named"
++
++ modprobe capability >/dev/null 2>&1 || true
++
++ # dirs under /var/run can go away on reboots.
++ mkdir -p /var/run/bind/run
++ mkdir -p /var/cache/bind
++ chmod 775 /var/run/bind/run
++ chown root:bind /var/run/bind/run >/dev/null 2>&1 || true
++
++ if [ ! -x /usr/sbin/named ]; then
++ echo "named binary missing - not starting"
++ exit 1
++ fi
++ if start-stop-daemon --start --quiet --exec /usr/sbin/named \
++ --pidfile /var/run/bind/run/named.pid -- $OPTIONS; then
++ if [ -x /sbin/resolvconf ] ; then
++ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo
++ fi
++ fi
++ echo "."
++ ;;
++
++ stop)
++ echo -n "Stopping domain name service: named"
++ if [ -x /sbin/resolvconf ]; then
++ /sbin/resolvconf -d lo
++ fi
++ /usr/sbin/rndc stop
++ echo "."
++ ;;
++
++ reload)
++ /usr/sbin/rndc reload
++ ;;
++
++ restart|force-reload)
++ $0 stop
++ sleep 2
++ $0 start
++ ;;
++
++ *)
++ echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
++ exit 1
++ ;;
++esac
++
++exit 0
diff --git a/packages/bind/bind-9.3.4-P1/configure.in.patch b/packages/bind/bind-9.3.4-P1/configure.in.patch
new file mode 100644
index 0000000000..78ae9271c6
--- /dev/null
+++ b/packages/bind/bind-9.3.4-P1/configure.in.patch
@@ -0,0 +1,14 @@
+--- bind-9.3.1/configure.in.orig 2005-07-10 21:21:18.000000000 +0200
++++ bind-9.3.1/configure.in 2005-07-10 21:24:31.000000000 +0200
+@@ -1414,7 +1414,10 @@
+ [AC_MSG_RESULT(no)
+ ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
+ ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
+- ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
++ ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
++
++ [AC_MSG_RESULT(assuming target platform has working inet_ntop)
++ ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"])
+
+
+ # On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
diff --git a/packages/bind/bind-9.3.4-P1/so_bsdcompat.patch b/packages/bind/bind-9.3.4-P1/so_bsdcompat.patch
new file mode 100644
index 0000000000..415156afb7
--- /dev/null
+++ b/packages/bind/bind-9.3.4-P1/so_bsdcompat.patch
@@ -0,0 +1,34 @@
+--- bind-9.3.1/lib/isc/unix/socket.c~ 2004-11-18 21:31:16.000000000 +0000
++++ bind-9.3.1/lib/isc/unix/socket.c 2005-11-07 13:34:28.000000000 +0000
+@@ -1344,7 +1344,7 @@
+ {
+ isc_socket_t *sock = NULL;
+ isc_result_t ret;
+-#if defined(USE_CMSG) || defined(SO_BSDCOMPAT)
++#if defined(USE_CMSG)
+ int on = 1;
+ #endif
+ char strbuf[ISC_STRERRORSIZE];
+@@ -1429,7 +1429,7 @@
+ return (ISC_R_UNEXPECTED);
+ }
+
+-#ifdef SO_BSDCOMPAT
++/* #ifdef SO_BSDCOMPAT
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,
+ (void *)&on, sizeof(on)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+@@ -1439,9 +1439,9 @@
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+- /* Press on... */
++
+ }
+-#endif
++#endif */
+
+ #if defined(USE_CMSG)
+ if (type == isc_sockettype_udp) {
+
+
diff --git a/packages/bind/bind_9.3.4-P1.bb b/packages/bind/bind_9.3.4-P1.bb
new file mode 100644
index 0000000000..59d2599a13
--- /dev/null
+++ b/packages/bind/bind_9.3.4-P1.bb
@@ -0,0 +1,38 @@
+DESCRIPTION = "ISC Internet Domain Name Server"
+SECTION = "console/network"
+HOMEPAGE = "http://www.isc.org/sw/bind/"
+LICENSE = "BSD"
+PR = "r0"
+
+DEPENDS = "openssl"
+
+SRC_URI = "ftp://ftp.isc.org/isc/bind9/9.3.4-P1/bind-9.3.4-P1.tar.gz \
+ file://conf.patch;patch=1 \
+ file://configure.in.patch;patch=1 \
+ file://so_bsdcompat.patch;patch=1 \
+ "
+
+EXTRA_OECONF = " --enable-ipv6=no --with-randomdev=/dev/random --disable-threads --sysconfdir=/etc/bind --localstatedir=/var --prefix=/usr"
+inherit autotools update-rc.d
+
+INITSCRIPT_NAME = "bind"
+INITSCRIPT_PARAMS = "defaults"
+
+do_install_append() {
+ rm "${D}/usr/bin/nslookup"
+ install -d "${D}/etc/bind"
+ install -d "${D}/etc/init.d"
+ install -m 644 ${S}/conf/* "${D}/etc/bind"
+ install -m 755 "${S}/init.d" "${D}/etc/init.d/bind"
+}
+
+CONFFILES_${PN} = " \
+ ${sysconfdir}/bind/named.conf \
+ ${sysconfdir}/bind/named.conf.local \
+ ${sysconfdir}/bind/named.conf.options \
+ ${sysconfdir}/bind/db.0 \
+ ${sysconfdir}/bind/db.127 \
+ ${sysconfdir}/bind/db.empty \
+ ${sysconfdir}/bind/db.local \
+ ${sysconfdir}/bind/db.root \
+ "
diff --git a/packages/binutils/binutils-2.18/binutils-configure-texinfo-version.patch b/packages/binutils/binutils-2.18/binutils-configure-texinfo-version.patch
new file mode 100644
index 0000000000..dd21aed862
--- /dev/null
+++ b/packages/binutils/binutils-2.18/binutils-configure-texinfo-version.patch
@@ -0,0 +1,22 @@
+--- binutils-2.18/configure.orig 2007-10-11 21:09:27.000000000 -0700
++++ binutils-2.18/configure 2007-10-11 21:10:20.000000000 -0700
+@@ -6128,7 +6128,7 @@ case " $build_configdirs " in
+ # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
+--- binutils-2.18/configure.ac.orig 2007-10-11 21:10:54.000000000 -0700
++++ binutils-2.18/configure.ac 2007-10-11 21:11:13.000000000 -0700
+@@ -2403,7 +2403,7 @@ changequote(,)
+ # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
diff --git a/packages/binutils/binutils_2.18.bb b/packages/binutils/binutils_2.18.bb
index a9b4d995b2..78000c7af6 100644
--- a/packages/binutils/binutils_2.18.bb
+++ b/packages/binutils/binutils_2.18.bb
@@ -3,6 +3,7 @@ require binutils.inc
SRC_URI = "\
${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1 \
+ file://binutils-configure-texinfo-version.patch;patch=1 \
file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
file://110-arm-eabi-conf.patch;patch=1 \
file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
diff --git a/packages/bluez/bluez-cups-backend_3.20.bb b/packages/bluez/bluez-cups-backend_3.20.bb
new file mode 100644
index 0000000000..64884fa904
--- /dev/null
+++ b/packages/bluez/bluez-cups-backend_3.20.bb
@@ -0,0 +1,26 @@
+require bluez-utils3.inc
+
+DEPENDS += "cups"
+
+# see bluez-utils3.inc for the explanation of these option
+EXTRA_OECONF = " \
+ --enable-bccmd \
+ --enable-hid2hci \
+ --disable-alsa \
+ --enable-cups \
+ --enable-glib \
+ --disable-sdpd \
+ --enable-network \
+ --enable-serial \
+ --enable-input \
+ --enable-audio \
+ --enable-echo \
+ --enable-configfile \
+ --enable-initscripts \
+ --enable-test \
+ "
+
+PACKAGES = "${PN}"
+
+FILES_${PN} = "${libdir}/cups/backend/bluetooth"
+RDEPENDS_${PN} = "cups" \ No newline at end of file
diff --git a/packages/bluez/bluez-gstreamer-plugin_3.20.bb b/packages/bluez/bluez-gstreamer-plugin_3.20.bb
new file mode 100644
index 0000000000..c5a1a9acee
--- /dev/null
+++ b/packages/bluez/bluez-gstreamer-plugin_3.20.bb
@@ -0,0 +1,26 @@
+require bluez-utils3.inc
+
+DEPENDS += "gstreamer gst-plugins-base "
+
+# see bluez-utils3.inc for the explanation of these option
+EXTRA_OECONF = " \
+ --enable-bccmd \
+ --enable-hid2hci \
+ --enable-alsa \
+ --disable-cups \
+ --enable-glib \
+ --enable-gstreamer \
+ --disable-sdpd \
+ --enable-network \
+ --enable-serial \
+ --enable-input \
+ --enable-audio \
+ --enable-echo \
+ --enable-configfile \
+ --enable-initscripts \
+ --enable-test \
+ "
+
+PACKAGES = "${PN}"
+
+FILES_${PN} = "${libdir}/gstreamer-0.10/libgstbluetooth.so"
diff --git a/packages/bluez/bluez-libs_3.20.bb b/packages/bluez/bluez-libs_3.20.bb
new file mode 100644
index 0000000000..6ddf62a4fb
--- /dev/null
+++ b/packages/bluez/bluez-libs_3.20.bb
@@ -0,0 +1 @@
+require bluez-libs.inc
diff --git a/packages/bluez/bluez-utils-alsa_3.20.bb b/packages/bluez/bluez-utils-alsa_3.20.bb
new file mode 100644
index 0000000000..e2f48fba49
--- /dev/null
+++ b/packages/bluez/bluez-utils-alsa_3.20.bb
@@ -0,0 +1,24 @@
+require bluez-utils3.inc
+
+DEPENDS += "alsa-lib"
+
+# see bluez-utils3.inc for the explanation of these option
+EXTRA_OECONF = " \
+ --enable-bccmd \
+ --disable-hid2hci \
+ --enable-alsa \
+ --disable-cups \
+ --enable-glib \
+ --disable-sdpd \
+ --enable-network \
+ --enable-serial \
+ --enable-input \
+ --enable-audio \
+ --enable-echo \
+ --enable-configfile \
+ --enable-initscripts \
+ --enable-test \
+ "
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${libdir}/alsa-lib/libasound*"
diff --git a/packages/bluez/bluez-utils_3.20.bb b/packages/bluez/bluez-utils_3.20.bb
new file mode 100644
index 0000000000..48f147aa69
--- /dev/null
+++ b/packages/bluez/bluez-utils_3.20.bb
@@ -0,0 +1,29 @@
+require bluez-utils3.inc
+
+# see bluez-utils3.inc for the explanation of these option
+EXTRA_OECONF = " \
+ --enable-bccmd \
+ --enable-hid2hci \
+ --disable-alsa \
+ --disable-cups \
+ --enable-glib \
+ --disable-sdpd \
+ --enable-network \
+ --enable-serial \
+ --enable-input \
+ --enable-audio \
+ --enable-echo \
+ --enable-configfile \
+ --enable-initscripts \
+ --enable-test \
+ "
+
+CONFFILES_${PN} = " \
+ ${sysconfdir}/bluetooth/hcid.conf \
+ ${sysconfdir}/default/bluetooth \
+ "
+
+CONFFILES_${PN}-compat = " \
+ ${sysconfdir}/bluetooth/rfcomm.conf \
+ "
+
diff --git a/packages/busybox/busybox-1.7.2/.mtn2git_empty b/packages/busybox/busybox-1.7.2/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/.mtn2git_empty
diff --git a/packages/busybox/busybox-1.7.2/angstrom/.mtn2git_empty b/packages/busybox/busybox-1.7.2/angstrom/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/angstrom/.mtn2git_empty
diff --git a/packages/busybox/busybox-1.7.2/angstrom/defconfig b/packages/busybox/busybox-1.7.2/angstrom/defconfig
new file mode 100644
index 0000000000..eb0b8d7c64
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/angstrom/defconfig
@@ -0,0 +1,647 @@
+#
+# Automatically generated make config: don't edit
+#
+HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_NITPICK is not set
+# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+# CONFIG_FEATURE_INSTALLER is not set
+CONFIG_LOCALE_SUPPORT=y
+CONFIG_GETOPT_LONG=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+# CONFIG_FEATURE_SUID is not set
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+# CONFIG_SELINUX is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_FULL_LIBBUSYBOX is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+USING_CROSS_COMPILER=y
+CROSS_COMPILER_PREFIX="arm-angstrom-linux-gnueabi-"
+CONFIG_BUILD_AT_ONCE=y
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_NO_DEBUG_LIB is not set
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+CONFIG_DEBUG_YANK_SUSv2=y
+
+#
+# Installation Options
+#
+# CONFIG_INSTALL_NO_USR is not set
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_MD5_SIZE_VS_SPEED=2
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+CONFIG_AR=y
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+CONFIG_BUNZIP2=y
+CONFIG_CPIO=y
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GUNZIP=y
+# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
+CONFIG_GZIP=y
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_BZIP2=y
+# CONFIG_FEATURE_TAR_LZMA is not set
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_GZIP=y
+# CONFIG_FEATURE_TAR_COMPRESS is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+CONFIG_UNZIP=y
+
+#
+# Common options for cpio and tar
+#
+# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
+# CONFIG_FEATURE_DEB_TAR_GZ is not set
+# CONFIG_FEATURE_DEB_TAR_BZ2 is not set
+# CONFIG_FEATURE_DEB_TAR_LZMA is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+# CONFIG_CAL is not set
+CONFIG_CAT=y
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_CMP is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+CONFIG_CUT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+CONFIG_DIFF=y
+CONFIG_FEATURE_DIFF_BINARY=y
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_FEATURE_DIFF_MINIMAL is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+CONFIG_EXPR=y
+# CONFIG_EXPR_MATH_SUPPORT_64 is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+# CONFIG_LENGTH is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+CONFIG_OD=y
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_STAT is not set
+# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TEST=y
+# CONFIG_FEATURE_TEST_64 is not set
+CONFIG_TOUCH=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WATCH=y
+CONFIG_WC=y
+CONFIG_WHO=y
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_RUN_PARTS=y
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_MATH=y
+# CONFIG_ED is not set
+CONFIG_PATCH=y
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+# CONFIG_INIT is not set
+# CONFIG_DEBUG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+# CONFIG_HALT is not set
+# CONFIG_MESG is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_SHADOW is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_ADDGROUP is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_DELUSER is not set
+# CONFIG_GETTY is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+# CONFIG_LOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_SU is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_E2FSCK=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+CONFIG_MKE2FS=y
+# CONFIG_TUNE2FS is not set
+# CONFIG_E2LABEL is not set
+# CONFIG_FINDFS is not set
+
+#
+# Linux Module Utilities
+#
+CONFIG_INSMOD=y
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+CONFIG_MODPROBE=y
+CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y
+
+#
+# Options common to multiple modutils
+#
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+# CONFIG_FEATURE_2_4_MODULES is not set
+CONFIG_FEATURE_2_6_MODULES=y
+# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
+
+#
+# Linux System Utilities
+#
+CONFIG_DMESG=y
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+FDISK_SUPPORT_LARGE_DISKS=y
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FREERAMDISK is not set
+CONFIG_FSCK_MINIX=y
+CONFIG_MKFS_MINIX=y
+
+#
+# Minix filesystem support
+#
+CONFIG_FEATURE_MINIX2=y
+# CONFIG_GETOPT is not set
+CONFIG_HEXDUMP=y
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+CONFIG_LOSETUP=y
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_V0 is not set
+CONFIG_MORE=y
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_MOUNT=y
+CONFIG_FEATURE_MOUNT_NFS=y
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_READPROFILE is not set
+# CONFIG_SETARCH is not set
+CONFIG_SWAPONOFF=y
+CONFIG_SWITCH_ROOT=y
+CONFIG_UMOUNT=y
+# CONFIG_FEATURE_UMOUNT_ALL is not set
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_CROND is not set
+# CONFIG_DEBUG_CROND_OPTION is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_EJECT is not set
+# CONFIG_LAST is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_FLAGCS is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+CONFIG_STRINGS=y
+# CONFIG_SETSID is not set
+# CONFIG_TASKSET is not set
+CONFIG_TIME=y
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+CONFIG_FEATURE_IPV6=y
+# CONFIG_ARPING is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_WITHOUT_INETD is not set
+# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+CONFIG_IFUPDOWN=y
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+# CONFIG_FEATURE_IFUPDOWN_IPX is not set
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_NAMEIF is not set
+CONFIG_NC=y
+# CONFIG_NC_GAPING_SECURITY_HOLE is not set
+CONFIG_NETSTAT=y
+CONFIG_NSLOOKUP=y
+CONFIG_PING=y
+CONFIG_FEATURE_FANCY_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING6=y
+CONFIG_ROUTE=y
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_INETD is not set
+CONFIG_TFTP=y
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_DEBUG_TFTP is not set
+CONFIG_TRACEROUTE=y
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+
+#
+# udhcp Server/Client
+#
+CONFIG_APP_UDHCPD=y
+CONFIG_APP_UDHCPC=y
+CONFIG_APP_DUMPLEASES=y
+CONFIG_FEATURE_UDHCP_SYSLOG=y
+# CONFIG_FEATURE_UDHCP_DEBUG is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_IP6_LITERAL=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+# CONFIG_ZCIP is not set
+
+#
+# Process Utilities
+#
+CONFIG_FREE=y
+CONFIG_FUSER=y
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_RENICE=y
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_UPTIME=y
+
+#
+# Shells
+#
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_LASH is not set
+# CONFIG_FEATURE_SH_IS_MSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+CONFIG_ASH=y
+
+#
+# Ash Shell Options
+#
+CONFIG_ASH_JOB_CONTROL=y
+# CONFIG_ASH_READ_NCHARS is not set
+# CONFIG_ASH_READ_TIMEOUT is not set
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_MATH_SUPPORT=y
+# CONFIG_ASH_MATH_SUPPORT_64 is not set
+CONFIG_ASH_GETOPTS=y
+# CONFIG_ASH_BUILTIN_ECHO is not set
+CONFIG_ASH_BUILTIN_TEST=y
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_HUSH is not set
+# CONFIG_LASH is not set
+# CONFIG_MSH is not set
+
+#
+# Bourne Shell Options
+#
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
+CONFIG_FEATURE_COMMAND_EDITING=y
+# CONFIG_FEATURE_COMMAND_EDITING_VI is not set
+CONFIG_FEATURE_COMMAND_HISTORY=63
+# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
+CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
+# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
+CONFIG_FEATURE_SH_FANCY_PROMPT=y
+
+#
+# System Logging Utilities
+#
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_KLOGD=y
+CONFIG_LOGGER=y
diff --git a/packages/busybox/busybox-1.7.2/busybox-mdev.sh b/packages/busybox/busybox-1.7.2/busybox-mdev.sh
new file mode 100755
index 0000000000..9744322fa9
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/busybox-mdev.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+MDEV=/sbin/mdev
+DESC="Busybox mdev setup"
+
+# Complain if thing's aren't right
+if [ ! -e /proc/filesystems ]; then
+ echo "mdev requires a mounted procfs, not started."
+ exit 1
+fi
+
+if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
+ echo "mdev requires tmpfs support, not started."
+ exit 1
+fi
+
+if [ ! -d /sys/class/ ]; then
+ echo "mdev requires a mounted sysfs, not started."
+ exit 1
+fi
+
+if [ ! -e /proc/sys/kernel/hotplug ]; then
+ echo "mdev requires hotplug support, not started."
+ exit 1
+fi
+
+# We need to unmount /dev/pts/ and remount it later over the tmpfs
+if mountpoint -q /dev/pts/; then
+ umount -l /dev/pts/
+fi
+
+if mountpoint -q /dev/shm/; then
+ umount -l /dev/shm/
+fi
+
+# Create tmpfs for /dev
+echo "Creating tmpfs at /dev"
+mount -t tmpfs tmpfs /dev -o size=800k
+
+# Register mdev as hotplug event helper
+echo "$MDEV" > /proc/sys/kernel/hotplug
+
+# Populate /dev from /sys info
+echo "Populating /dev using mdev"
+$MDEV -s
+
+# Touch .udev to inform scripts that /dev needs no further setup
+touch /dev/.udev
+
+# Mount devpts
+TTYGRP=5
+TTYMODE=620
+mkdir -m 755 -p /dev/pts
+if [ ! -e /dev/ptmx ]; then
+ mknod -m 666 /dev/ptmx c 5 2
+fi
+mount -t devpts devpts /dev/pts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
+
+# Make shm directory
+mkdir -m 755 -p /dev/shm
+
+# Make extraneous links
+ln -sf /proc/self/fd /dev/fd
+ln -sf /proc/self/fd/0 /dev/stdin
+ln -sf /proc/self/fd/1 /dev/stdout
+ln -sf /proc/self/fd/2 /dev/stderr
+ln -sf /proc/kcore /dev/core
+ln -sf /proc/asound/oss/sndstat /dev/sndstat
+
+exit 0
diff --git a/packages/busybox/busybox-1.7.2/defconfig b/packages/busybox/busybox-1.7.2/defconfig
new file mode 100644
index 0000000000..7308eead76
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/defconfig
@@ -0,0 +1,647 @@
+#
+# Automatically generated make config: don't edit
+#
+HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_NITPICK is not set
+# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+# CONFIG_FEATURE_INSTALLER is not set
+CONFIG_LOCALE_SUPPORT=y
+CONFIG_GETOPT_LONG=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+# CONFIG_FEATURE_SUID is not set
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+# CONFIG_SELINUX is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_FULL_LIBBUSYBOX is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+USING_CROSS_COMPILER=y
+CROSS_COMPILER_PREFIX="arm-angstrom-linux-gnueabi-"
+CONFIG_BUILD_AT_ONCE=y
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_NO_DEBUG_LIB is not set
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+CONFIG_DEBUG_YANK_SUSv2=y
+
+#
+# Installation Options
+#
+# CONFIG_INSTALL_NO_USR is not set
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_MD5_SIZE_VS_SPEED=2
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+CONFIG_AR=y
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+CONFIG_BUNZIP2=y
+CONFIG_CPIO=y
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GUNZIP=y
+# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
+CONFIG_GZIP=y
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_BZIP2=y
+# CONFIG_FEATURE_TAR_LZMA is not set
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_GZIP=y
+# CONFIG_FEATURE_TAR_COMPRESS is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+CONFIG_UNZIP=y
+
+#
+# Common options for cpio and tar
+#
+# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
+# CONFIG_FEATURE_DEB_TAR_GZ is not set
+# CONFIG_FEATURE_DEB_TAR_BZ2 is not set
+# CONFIG_FEATURE_DEB_TAR_LZMA is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+# CONFIG_CAL is not set
+CONFIG_CAT=y
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_CMP is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+CONFIG_CUT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+CONFIG_DIFF=y
+CONFIG_FEATURE_DIFF_BINARY=y
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_FEATURE_DIFF_MINIMAL is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+CONFIG_EXPR=y
+# CONFIG_EXPR_MATH_SUPPORT_64 is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+# CONFIG_LENGTH is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+CONFIG_OD=y
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_STAT is not set
+# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TEST=y
+# CONFIG_FEATURE_TEST_64 is not set
+CONFIG_TOUCH=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WATCH=y
+CONFIG_WC=y
+CONFIG_WHO=y
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_RUN_PARTS=y
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_MATH=y
+# CONFIG_ED is not set
+CONFIG_PATCH=y
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+# CONFIG_INIT is not set
+# CONFIG_DEBUG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+# CONFIG_HALT is not set
+# CONFIG_MESG is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_SHADOW is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_ADDGROUP is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_DELUSER is not set
+# CONFIG_GETTY is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+# CONFIG_LOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_SU is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_E2FSCK=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+CONFIG_MKE2FS=y
+# CONFIG_TUNE2FS is not set
+# CONFIG_E2LABEL is not set
+# CONFIG_FINDFS is not set
+
+#
+# Linux Module Utilities
+#
+CONFIG_INSMOD=y
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+CONFIG_MODPROBE=y
+CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y
+
+#
+# Options common to multiple modutils
+#
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+# CONFIG_FEATURE_2_4_MODULES is not set
+CONFIG_FEATURE_2_6_MODULES=y
+# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
+
+#
+# Linux System Utilities
+#
+CONFIG_DMESG=y
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+FDISK_SUPPORT_LARGE_DISKS=y
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FREERAMDISK is not set
+CONFIG_FSCK_MINIX=y
+CONFIG_MKFS_MINIX=y
+
+#
+# Minix filesystem support
+#
+CONFIG_FEATURE_MINIX2=y
+# CONFIG_GETOPT is not set
+CONFIG_HEXDUMP=y
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+CONFIG_LOSETUP=y
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_V0 is not set
+CONFIG_MORE=y
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_MOUNT=y
+CONFIG_FEATURE_MOUNT_NFS=y
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_READPROFILE is not set
+# CONFIG_SETARCH is not set
+CONFIG_SWAPONOFF=y
+# CONFIG_SWITCH_ROOT is not set
+CONFIG_UMOUNT=y
+# CONFIG_FEATURE_UMOUNT_ALL is not set
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_CROND is not set
+# CONFIG_DEBUG_CROND_OPTION is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_EJECT is not set
+# CONFIG_LAST is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_FLAGCS is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+CONFIG_STRINGS=y
+# CONFIG_SETSID is not set
+# CONFIG_TASKSET is not set
+CONFIG_TIME=y
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+CONFIG_FEATURE_IPV6=y
+# CONFIG_ARPING is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_WITHOUT_INETD is not set
+# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+CONFIG_IFUPDOWN=y
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+# CONFIG_FEATURE_IFUPDOWN_IPX is not set
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_NAMEIF is not set
+CONFIG_NC=y
+# CONFIG_NC_GAPING_SECURITY_HOLE is not set
+CONFIG_NETSTAT=y
+CONFIG_NSLOOKUP=y
+CONFIG_PING=y
+CONFIG_FEATURE_FANCY_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING6=y
+CONFIG_ROUTE=y
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_INETD is not set
+CONFIG_TFTP=y
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_DEBUG_TFTP is not set
+CONFIG_TRACEROUTE=y
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+
+#
+# udhcp Server/Client
+#
+CONFIG_APP_UDHCPD=y
+CONFIG_APP_UDHCPC=y
+CONFIG_APP_DUMPLEASES=y
+CONFIG_FEATURE_UDHCP_SYSLOG=y
+# CONFIG_FEATURE_UDHCP_DEBUG is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_IP6_LITERAL=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+# CONFIG_ZCIP is not set
+
+#
+# Process Utilities
+#
+CONFIG_FREE=y
+CONFIG_FUSER=y
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_RENICE=y
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_UPTIME=y
+
+#
+# Shells
+#
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_LASH is not set
+# CONFIG_FEATURE_SH_IS_MSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+CONFIG_ASH=y
+
+#
+# Ash Shell Options
+#
+CONFIG_ASH_JOB_CONTROL=y
+# CONFIG_ASH_READ_NCHARS is not set
+# CONFIG_ASH_READ_TIMEOUT is not set
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_MATH_SUPPORT=y
+# CONFIG_ASH_MATH_SUPPORT_64 is not set
+CONFIG_ASH_GETOPTS=y
+# CONFIG_ASH_BUILTIN_ECHO is not set
+CONFIG_ASH_BUILTIN_TEST=y
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_HUSH is not set
+# CONFIG_LASH is not set
+# CONFIG_MSH is not set
+
+#
+# Bourne Shell Options
+#
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
+CONFIG_FEATURE_COMMAND_EDITING=y
+# CONFIG_FEATURE_COMMAND_EDITING_VI is not set
+CONFIG_FEATURE_COMMAND_HISTORY=63
+# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
+CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
+# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
+CONFIG_FEATURE_SH_FANCY_PROMPT=y
+
+#
+# System Logging Utilities
+#
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_KLOGD=y
+CONFIG_LOGGER=y
diff --git a/packages/busybox/busybox-1.7.2/udhcpscript.patch b/packages/busybox/busybox-1.7.2/udhcpscript.patch
new file mode 100644
index 0000000000..fc21d440cd
--- /dev/null
+++ b/packages/busybox/busybox-1.7.2/udhcpscript.patch
@@ -0,0 +1,17 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- busybox-1.00-rc3/examples/udhcp/simple.script~udhcpscript
++++ busybox-1.00-rc3/examples/udhcp/simple.script
+@@ -17,8 +17,7 @@
+ /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+ if [ -n "$router" ] ; then
+- echo "deleting routers"
+- while route del default gw 0.0.0.0 dev $interface ; do
++ while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+ :
+ done
+
diff --git a/packages/busybox/busybox_1.7.2.bb b/packages/busybox/busybox_1.7.2.bb
new file mode 100644
index 0000000000..24e1b61df6
--- /dev/null
+++ b/packages/busybox/busybox_1.7.2.bb
@@ -0,0 +1,119 @@
+require busybox.inc
+
+PR = "r0"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
+ file://busybox-cron \
+ file://busybox-httpd \
+ file://busybox-udhcpd \
+ file://default.script \
+ file://hwclock.sh \
+ file://mount.busybox \
+ file://syslog \
+ file://syslog.conf \
+ file://udhcpscript.patch;patch=1 \
+ file://umount.busybox"
+
+
+SRC_URI += "http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-ash.patch;patch=1 \
+ http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-iptun.patch;patch=1 \
+ http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-logger.patch;patch=1 \
+ http://busybox.net/downloads/fixes-1.7.2/busybox-1.7.2-tail.patch;patch=1 \
+ file://defconfig"
+
+EXTRA_OEMAKE_append = " V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
+
+do_configure () {
+ install -m 0644 ${WORKDIR}/defconfig ${S}/.config
+ cml1_do_configure
+}
+
+do_compile () {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ base_do_compile
+}
+
+do_install () {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ install -d ${D}${sysconfdir}/init.d
+ oe_runmake "PREFIX=${D}" install
+ cp -pPR ${S}/_install/* ${D}/
+
+ # Move everything to /busybox (not supposed to end up in any package)
+ install -d ${D}/busybox
+ ls ${D} -R
+
+ cp -dPr ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/
+ # Move the busybox binary back to /bin
+ install -d ${D}${base_bindir}
+ mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/
+ # Move back the sh symlink
+ test -h ${D}/busybox${base_bindir}/sh && mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/
+
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
+ if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
+ # Move crond back to /usr/sbin/crond
+ install -d ${D}${sbindir}
+ mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/
+
+ install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then
+ # Move httpd back to /usr/sbin/httpd
+ install -d ${D}${sbindir}
+ mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/
+
+ install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
+ install -d ${D}/srv/www
+ fi
+ if grep "CONFIG_APP_UDHCPD=y" ${WORKDIR}/defconfig; then
+ # Move udhcpd back to /usr/sbin/udhcpd
+ install -d ${D}${sbindir}
+ mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/
+
+ install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then
+ # Move hwclock back to /sbin/hwclock
+ install -d ${D}${base_sbindir}
+ mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/
+
+ install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_APP_UDHCPC=y" ${WORKDIR}/defconfig; then
+ # Move dhcpc back to /usr/sbin/udhcpc
+ install -d ${D}${base_sbindir}
+ mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/
+
+ install -d ${D}${sysconfdir}/udhcpc.d
+ install -d ${D}${datadir}/udhcpc
+ install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default
+ install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
+ fi
+
+ install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+}
+
+pkg_prerm_${PN} () {
+ # This is so you can make busybox commit suicide - removing busybox with no other packages
+ # providing its files, this will make update-alternatives work, but the update-rc.d part
+ # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
+ tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
+ ln -s /bin/busybox $tmpdir/[
+ ln -s /bin/busybox $tmpdir/test
+ ln -s /bin/busybox $tmpdir/head
+ ln -s /bin/busybox $tmpdir/sh
+ ln -s /bin/busybox $tmpdir/basename
+ ln -s /bin/busybox $tmpdir/echo
+ ln -s /bin/busybox $tmpdir/mv
+ ln -s /bin/busybox $tmpdir/ln
+ ln -s /bin/busybox $tmpdir/dirname
+ ln -s /bin/busybox $tmpdir/rm
+ ln -s /bin/busybox $tmpdir/sed
+ ln -s /bin/busybox $tmpdir/sort
+ export PATH=$PATH:$tmpdir
+ while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; bn=`basename $link`; sh /usr/bin/update-alternatives --remove $bn $to; done </etc/busybox.links
+}
diff --git a/packages/dropbear/dropbear.inc b/packages/dropbear/dropbear.inc
index a53d2dbb87..acd09d89fc 100644
--- a/packages/dropbear/dropbear.inc
+++ b/packages/dropbear/dropbear.inc
@@ -26,7 +26,7 @@ BINCOMMANDS = "dbclient ssh scp"
EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
do_configure_prepend() {
- if [ "x${DISTRO}" != "xfamiliar" -a "${DISTRO_TYPE}" = "debug" ]; then
+ if [ "x${DISTRO_TYPE}" = "xdebug" ]; then
oenote "WARNING: applying allow-nopw.patch which allows password-less logins!"
patch -p1 < ${WORKDIR}/allow-nopw.patch
fi
diff --git a/packages/gcc/gcc-4.2.2/.mtn2git_empty b/packages/gcc/gcc-4.2.2/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/.mtn2git_empty
diff --git a/packages/gcc/gcc-4.2.2/100-uclibc-conf.patch b/packages/gcc/gcc-4.2.2/100-uclibc-conf.patch
new file mode 100644
index 0000000000..4243ff7b91
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/100-uclibc-conf.patch
@@ -0,0 +1,200 @@
+--- gcc/libgomp/configure
++++ gcc/libgomp/configure
+@@ -3771,7 +3771,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/gcc/config/cris/linux.h
++++ gcc/gcc/config/cris/linux.h
+@@ -74,7 +74,11 @@
+ #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+
+ #undef CRIS_SUBTARGET_VERSION
+-#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
++#if UCLIBC_DEFAULT
++# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
++#else
++# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
++#endif
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+--- gcc/libstdc++-v3/configure
++++ gcc/libstdc++-v3/configure
+@@ -4276,7 +4276,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/zlib/configure
++++ gcc/zlib/configure
+@@ -3422,7 +3422,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libobjc/configure
++++ gcc/libobjc/configure
+@@ -3309,7 +3309,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libgfortran/configure
++++ gcc/libgfortran/configure
+@@ -3695,7 +3695,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libmudflap/configure
++++ gcc/libmudflap/configure
+@@ -5378,7 +5378,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/boehm-gc/configure
++++ gcc/boehm-gc/configure
+@@ -4316,7 +4316,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libffi/configure
++++ gcc/libffi/configure
+@@ -3453,7 +3453,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libssp/configure
++++ gcc/libssp/configure
+@@ -4409,7 +4409,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/contrib/regression/objs-gcc.sh
++++ gcc/contrib/regression/objs-gcc.sh
+@@ -105,6 +105,10 @@
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- gcc/libjava/classpath/ltconfig
++++ gcc/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+--- gcc/libjava/classpath/configure
++++ gcc/libjava/classpath/configure
+@@ -4665,7 +4665,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libjava/configure
++++ gcc/libjava/configure
+@@ -5212,7 +5212,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/libtool.m4
++++ gcc/libtool.m4
+@@ -739,7 +739,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+--- gcc/ltconfig
++++ gcc/ltconfig
+@@ -603,7 +603,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1251,7 +1251,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/packages/gcc/gcc-4.2.2/103-uclibc-conf-noupstream.patch b/packages/gcc/gcc-4.2.2/103-uclibc-conf-noupstream.patch
new file mode 100644
index 0000000000..09c9bbecfb
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/103-uclibc-conf-noupstream.patch
@@ -0,0 +1,11 @@
+--- gcc/gcc/config.gcc.uclibc100-sh~ 2006-03-06 20:46:56 +0100
++++ gcc/gcc/config.gcc 2006-03-10 15:02:41 +0100
+@@ -1905,7 +1905,7 @@
+ ;;
+ sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
+ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
+- sh-*-linux* | sh[346lbe]*-*-linux* | \
++ sh*-*-linux* | sh[346lbe]*-*-linux* | \
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff --git a/packages/gcc/gcc-4.2.2/110-arm-eabi.patch b/packages/gcc/gcc-4.2.2/110-arm-eabi.patch
new file mode 100644
index 0000000000..acebe5308f
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/110-arm-eabi.patch
@@ -0,0 +1,27 @@
+--- gcc-2005q3-1.orig/gcc/config.gcc 2005-10-31 19:02:54.000000000 +0300
++++ gcc-2005q3-1/gcc/config.gcc 2006-01-27 01:09:09.000000000 +0300
+@@ -674,7 +674,7 @@
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-arm"
+ case ${target} in
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ # The BPABI long long divmod functions return a 128-bit value in
+
+diff -urN gcc-2005q3-2/gcc/config/arm/linux-eabi.h gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h
+--- gcc-2005q3-2/gcc/config/arm/linux-eabi.h 2005-12-07 23:14:16.000000000 +0300
++++ gcc-2005q3-2.new/gcc/config/arm/linux-eabi.h 2006-03-29 19:02:34.000000000 +0400
+@@ -53,7 +53,11 @@
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+ #undef LINUX_TARGET_INTERPRETER
++#ifdef USE_UCLIBC
++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
++#else
+ #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
++#endif
+
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
diff --git a/packages/gcc/gcc-4.2.2/200-uclibc-locale.patch b/packages/gcc/gcc-4.2.2/200-uclibc-locale.patch
new file mode 100644
index 0000000000..ea21388b75
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/200-uclibc-locale.patch
@@ -0,0 +1,2790 @@
+--- gcc/libstdc++-v3/acinclude.m4
++++ gcc/libstdc++-v3/acinclude.m4
+@@ -1369,7 +1369,7 @@
+ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
+ [use MODEL for target locale package],
+- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
+
+ # Deal with gettext issues. Default to not using it (=no) until we detect
+ # support for it later. Let the user turn it off via --e/d, but let that
+@@ -1385,6 +1385,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ AC_EGREP_CPP([_GLIBCXX_ok], [
+ #include <features.h>
+@@ -1528,6 +1531,40 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++ AC_SUBST(glibcxx_MOFILES)
++ AC_SUBST(glibcxx_POFILES)
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno> // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
++#define __strtof_l(S, E, L) strtof((S), (E))
++#define __strtod_l(S, E, L) strtod((S), (E))
++#define __strtold_l(S, E, L) strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c) NULL
++#define __freelocale(a) ((void)0)
++#define __duplocale(a) __c_locale()
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ template<>
++ void
++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++ const __c_locale& __cloc)
++ {
++ if (!(__err & ios_base::failbit))
++ {
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
++ }
++ }
++
++ void
++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++ __c_locale __old)
++ {
++ __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ if (!__cloc)
++ {
++ // This named locale is not supported by the underlying OS.
++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++ "name not valid"));
++ }
++#endif
++ }
++
++ void
++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++ {
++ if (_S_get_c_locale() != __cloc)
++ __freelocale(__cloc);
++ }
++
++ __c_locale
++ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++ { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++ {
++ "LC_CTYPE",
++ "LC_NUMERIC",
++ "LC_TIME",
++ "LC_COLLATE",
++ "LC_MONETARY",
++ "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++ "LC_PAPER",
++ "LC_NAME",
++ "LC_ADDRESS",
++ "LC_TELEPHONE",
++ "LC_MEASUREMENT",
++ "LC_IDENTIFICATION"
++#endif
++ };
++}
++
++namespace std
++{
++ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++} // namespace std
+--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8 Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring> // get std::strlen
++#include <cstdio> // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h> // For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h> // For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> // For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++ extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++ typedef __locale_t __c_locale;
++#else
++ typedef int* __c_locale;
++#endif
++
++ // Convert numeric value of type _Tv to string and return length of
++ // string. If snprintf is available use it, otherwise fall back to
++ // the unsafe sprintf which, in general, can be dangerous and should
++ // be avoided.
++ template<typename _Tv>
++ int
++ __convert_from_v(char* __out,
++ const int __size __attribute__ ((__unused__)),
++ const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ _Tv __v, const __c_locale& __cloc, int __prec)
++ {
++ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++ _Tv __v, const __c_locale&, int __prec)
++ {
++# ifdef __UCLIBC_HAS_LOCALE__
++ char* __old = std::setlocale(LC_ALL, NULL);
++ char* __sav = new char[std::strlen(__old) + 1];
++ std::strcpy(__sav, __old);
++ std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++ __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++ std::setlocale(LC_ALL, __sav);
++ delete [] __sav;
++#endif
++ return __ret;
++ }
++}
++
++#endif
+--- gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,306 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++ // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_out(state_type& __state, const intern_type* __from,
++ const intern_type* __from_end, const intern_type*& __from_next,
++ extern_type* __to, extern_type* __to_end,
++ extern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++ // in case we fall back to wcrtomb and then continue, in a loop.
++ // NB: wcsnrtombs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++ __from_end - __from_next);
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // wcrtomb.
++ for (; __from < __from_next; ++__from)
++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ extern_type __buf[MB_LEN_MAX];
++ __tmp_state = __state;
++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++ if (__conv > static_cast<size_t>(__to_end - __to_next))
++ __ret = partial;
++ else
++ {
++ memcpy(__to_next, __buf, __conv);
++ __state = __tmp_state;
++ __to_next += __conv;
++ ++__from_next;
++ }
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ codecvt_base::result
++ codecvt<wchar_t, char, mbstate_t>::
++ do_in(state_type& __state, const extern_type* __from,
++ const extern_type* __from_end, const extern_type*& __from_next,
++ intern_type* __to, intern_type* __to_end,
++ intern_type*& __to_next) const
++ {
++ result __ret = ok;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we store a L'\0' and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++ for (__from_next = __from, __to_next = __to;
++ __from_next < __from_end && __to_next < __to_end
++ && __ret == ok;)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++ __from_end
++ - __from_next));
++ if (!__from_chunk_end)
++ __from_chunk_end = __from_end;
++
++ __from = __from_next;
++ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++ __from_chunk_end - __from_next,
++ __to_end - __to_next, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (;; ++__to_next, __from += __conv)
++ {
++ __conv = mbrtowc(__to_next, __from, __from_end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __from_next = __from;
++ __state = __tmp_state;
++ __ret = error;
++ }
++ else if (__from_next && __from_next < __from_chunk_end)
++ {
++ // It is unclear what to return in this case (see DR 382).
++ __to_next += __conv;
++ __ret = partial;
++ }
++ else
++ {
++ __from_next = __from_chunk_end;
++ __to_next += __conv;
++ }
++
++ if (__from_next < __from_end && __ret == ok)
++ {
++ if (__to_next < __to_end)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from_next;
++ *__to_next++ = L'\0';
++ }
++ else
++ __ret = partial;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_encoding() const throw()
++ {
++ // XXX This implementation assumes that the encoding is
++ // stateless and is either single-byte or variable-width.
++ int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ if (MB_CUR_MAX == 1)
++ __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_max_length() const throw()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++ // XXX Probably wrong for stateful encodings.
++ int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __ret;
++ }
++
++ int
++ codecvt<wchar_t, char, mbstate_t>::
++ do_length(state_type& __state, const extern_type* __from,
++ const extern_type* __end, size_t __max) const
++ {
++ int __ret = 0;
++ state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++ // in case we advance past it and then continue, in a loop.
++ // NB: mbsnrtowcs is a GNU extension
++
++ // A dummy internal buffer is needed in order for mbsnrtocws to consider
++ // its fourth parameter (it wouldn't with NULL as first parameter).
++ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++ * __max));
++ while (__from < __end && __max)
++ {
++ const extern_type* __from_chunk_end;
++ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++ __end
++ - __from));
++ if (!__from_chunk_end)
++ __from_chunk_end = __end;
++
++ const extern_type* __tmp_from = __from;
++ size_t __conv = mbsnrtowcs(__to, &__from,
++ __from_chunk_end - __from,
++ __max, &__state);
++ if (__conv == static_cast<size_t>(-1))
++ {
++ // In case of error, in order to stop at the exact place we
++ // have to start again from the beginning with a series of
++ // mbrtowc.
++ for (__from = __tmp_from;; __from += __conv)
++ {
++ __conv = mbrtowc(NULL, __from, __end - __from,
++ &__tmp_state);
++ if (__conv == static_cast<size_t>(-1)
++ || __conv == static_cast<size_t>(-2))
++ break;
++ }
++ __state = __tmp_state;
++ __ret += __from - __tmp_from;
++ break;
++ }
++ if (!__from)
++ __from = __from_chunk_end;
++
++ __ret += __from - __tmp_from;
++ __max -= __conv;
++
++ if (__from < __end && __max)
++ {
++ // XXX Probably wrong for stateful encodings
++ __tmp_state = __state;
++ ++__from;
++ ++__ret;
++ --__max;
++ }
++ }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++
++ return __ret;
++ }
++#endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++ // These are basically extensions to char_traits, and perhaps should
++ // be put there instead of here.
++ template<>
++ int
++ collate<char>::_M_compare(const char* __one, const char* __two) const
++ {
++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<char>::_M_transform(char* __to, const char* __from,
++ size_t __n) const
++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ int
++ collate<wchar_t>::_M_compare(const wchar_t* __one,
++ const wchar_t* __two) const
++ {
++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++ }
++
++ template<>
++ size_t
++ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++ size_t __n) const
++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L) wctype((S))
++#define __towupper_l(C, L) towupper((C))
++#define __towlower_l(C, L) towlower((C))
++#define __iswctype_l(C, M, L) iswctype((C), (M))
++#endif
++
++namespace std
++{
++ // NB: The other ctype<char> specializations are in src/locale.cc and
++ // various /config/os/* files.
++ template<>
++ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++ : ctype<char>(0, false, __refs)
++ {
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ ctype<wchar_t>::__wmask_type
++ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++ {
++ __wmask_type __ret;
++ switch (__m)
++ {
++ case space:
++ __ret = __wctype_l("space", _M_c_locale_ctype);
++ break;
++ case print:
++ __ret = __wctype_l("print", _M_c_locale_ctype);
++ break;
++ case cntrl:
++ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
++ break;
++ case upper:
++ __ret = __wctype_l("upper", _M_c_locale_ctype);
++ break;
++ case lower:
++ __ret = __wctype_l("lower", _M_c_locale_ctype);
++ break;
++ case alpha:
++ __ret = __wctype_l("alpha", _M_c_locale_ctype);
++ break;
++ case digit:
++ __ret = __wctype_l("digit", _M_c_locale_ctype);
++ break;
++ case punct:
++ __ret = __wctype_l("punct", _M_c_locale_ctype);
++ break;
++ case xdigit:
++ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
++ break;
++ case alnum:
++ __ret = __wctype_l("alnum", _M_c_locale_ctype);
++ break;
++ case graph:
++ __ret = __wctype_l("graph", _M_c_locale_ctype);
++ break;
++ default:
++ __ret = __wmask_type();
++ }
++ return __ret;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_toupper(wchar_t __c) const
++ { return __towupper_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ wchar_t
++ ctype<wchar_t>::do_tolower(wchar_t __c) const
++ { return __towlower_l(__c, _M_c_locale_ctype); }
++
++ const wchar_t*
++ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi)
++ {
++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++ ++__lo;
++ }
++ return __hi;
++ }
++
++ bool
++ ctype<wchar_t>::
++ do_is(mask __m, wchar_t __c) const
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ bool __ret = false;
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur]
++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ return __ret;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++ {
++ for (; __lo < __hi; ++__vec, ++__lo)
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ mask __m = 0;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++ __m |= _M_bit[__bitcur];
++ *__vec = __m;
++ }
++ return __hi;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++ {
++ while (__lo < __hi && !this->do_is(__m, *__lo))
++ ++__lo;
++ return __lo;
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++ {
++ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++ ++__lo;
++ return __lo;
++ }
++
++ wchar_t
++ ctype<wchar_t>::
++ do_widen(char __c) const
++ { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++ const char*
++ ctype<wchar_t>::
++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++ {
++ while (__lo < __hi)
++ {
++ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++ ++__lo;
++ ++__dest;
++ }
++ return __hi;
++ }
++
++ char
++ ctype<wchar_t>::
++ do_narrow(wchar_t __wc, char __dfault) const
++ {
++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++ return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++
++ const wchar_t*
++ ctype<wchar_t>::
++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++ char* __dest) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ if (_M_narrow_ok)
++ while (__lo < __hi)
++ {
++ if (*__lo >= 0 && *__lo < 128)
++ *__dest = _M_narrow[*__lo];
++ else
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ }
++ ++__lo;
++ ++__dest;
++ }
++ else
++ while (__lo < __hi)
++ {
++ const int __c = wctob(*__lo);
++ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++ ++__lo;
++ ++__dest;
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ return __hi;
++ }
++
++ void
++ ctype<wchar_t>::_M_initialize_ctype()
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++ wint_t __i;
++ for (__i = 0; __i < 128; ++__i)
++ {
++ const int __c = wctob(__i);
++ if (__c == EOF)
++ break;
++ else
++ _M_narrow[__i] = static_cast<char>(__c);
++ }
++ if (__i == 128)
++ _M_narrow_ok = true;
++ else
++ _M_narrow_ok = false;
++ for (size_t __j = 0;
++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++ _M_widen[__j] = btowc(__j);
++
++ for (size_t __k = 0; __k <= 11; ++__k)
++ {
++ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++ }
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#endif
++ }
++#endif // _GLIBCXX_USE_WCHAR_T
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++ const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++ // Specializations.
++ template<>
++ string
++ messages<char>::do_get(catalog, int, int, const string& __dfault) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++ __uselocale(__old);
++ return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ const char* __msg = gettext(__dfault.c_str());
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return string(__msg);
++#else
++ const char* __msg = gettext(__dfault.c_str());
++ return string(__msg);
++#endif
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ wstring
++ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++ {
++# ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(_M_c_locale_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ __uselocale(__old);
++ return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_messages);
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ setlocale(LC_ALL, __old);
++ free(__old);
++ return _M_convert_from_char(__msg);
++# else
++ char* __msg = gettext(_M_convert_to_char(__dfault));
++ return _M_convert_from_char(__msg);
++# endif
++ }
++#endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2 messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++ const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D) ((void)0)
++#define __bindtextdomain(D,P) ((void)0)
++#endif
++
++ // Non-virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::messages(size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++ _M_name_messages(_S_get_c_name())
++ { }
++
++ template<typename _CharT>
++ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++ _M_name_messages(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_messages = __tmp;
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++ const char* __dir) const
++ {
++ __bindtextdomain(__s.c_str(), __dir);
++ return this->do_open(__s, __loc);
++ }
++
++ // Virtual member functions.
++ template<typename _CharT>
++ messages<_CharT>::~messages()
++ {
++ if (_M_name_messages != _S_get_c_name())
++ delete [] _M_name_messages;
++ _S_destroy_c_locale(_M_c_locale_messages);
++ }
++
++ template<typename _CharT>
++ typename messages<_CharT>::catalog
++ messages<_CharT>::do_open(const basic_string<char>& __s,
++ const locale&) const
++ {
++ // No error checking is done, assume the catalog exists and can
++ // be used.
++ __textdomain(__s.c_str());
++ return 0;
++ }
++
++ template<typename _CharT>
++ void
++ messages<_CharT>::do_close(catalog) const
++ { }
++
++ // messages_byname
++ template<typename _CharT>
++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++ : messages<_CharT>(__refs)
++ {
++ if (this->_M_name_messages != locale::facet::_S_get_c_name())
++ delete [] this->_M_name_messages;
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ this->_M_name_messages = __tmp;
++
++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++ {
++ this->_S_destroy_c_locale(this->_M_c_locale_messages);
++ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++ }
++ }
+--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ // Construct and return valid pattern consisting of some combination of:
++ // space none symbol sign value
++ money_base::pattern
++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++ {
++ pattern __ret;
++
++ // This insanely complicated routine attempts to construct a valid
++ // pattern for use with monyepunct. A couple of invariants:
++
++ // if (__precedes) symbol -> value
++ // else value -> symbol
++
++ // if (__space) space
++ // else none
++
++ // none == never first
++ // space never first or last
++
++ // Any elegant implementations of this are welcome.
++ switch (__posn)
++ {
++ case 0:
++ case 1:
++ // 1 The sign precedes the value and symbol.
++ __ret.field[0] = sign;
++ if (__space)
++ {
++ // Pattern starts with sign.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[3] = symbol;
++ }
++ __ret.field[2] = space;
++ }
++ else
++ {
++ // Pattern starts with sign and ends with none.
++ if (__precedes)
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[1] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[3] = none;
++ }
++ break;
++ case 2:
++ // 2 The sign follows the value and symbol.
++ if (__space)
++ {
++ // Pattern either ends with sign.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[2] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[2] = symbol;
++ }
++ __ret.field[1] = space;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ // Pattern ends with sign then none.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = value;
++ }
++ else
++ {
++ __ret.field[0] = value;
++ __ret.field[1] = symbol;
++ }
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ break;
++ case 3:
++ // 3 The sign immediately precedes the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = sign;
++ __ret.field[1] = symbol;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = sign;
++ __ret.field[3] = symbol;
++ }
++ else
++ {
++ __ret.field[1] = sign;
++ __ret.field[2] = symbol;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ case 4:
++ // 4 The sign immediately follows the symbol.
++ if (__precedes)
++ {
++ __ret.field[0] = symbol;
++ __ret.field[1] = sign;
++ if (__space)
++ {
++ __ret.field[2] = space;
++ __ret.field[3] = value;
++ }
++ else
++ {
++ __ret.field[2] = value;
++ __ret.field[3] = none;
++ }
++ }
++ else
++ {
++ __ret.field[0] = value;
++ if (__space)
++ {
++ __ret.field[1] = space;
++ __ret.field[2] = symbol;
++ __ret.field[3] = sign;
++ }
++ else
++ {
++ __ret.field[1] = symbol;
++ __ret.field[2] = sign;
++ __ret.field[3] = none;
++ }
++ }
++ break;
++ default:
++ ;
++ }
++ return __ret;
++ }
++
++ template<>
++ void
++ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == true
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ void
++ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++ const char*)
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<char, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = "";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = "";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = "";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++ __cloc));
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ if (!__nposn)
++ _M_data->_M_negative_sign = "()";
++ else
++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++ __cloc);
++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++ // _Intl == false
++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++ }
++ }
++
++ template<>
++ moneypunct<char, true>::~moneypunct()
++ { delete _M_data; }
++
++ template<>
++ moneypunct<char, false>::~moneypunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, true>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++ __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ void
++ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const char*)
++#else
++ const char* __name)
++#endif
++ {
++ if (!_M_data)
++ _M_data = new __moneypunct_cache<wchar_t, false>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = 0;
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = 0;
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = 0;
++ _M_data->_M_frac_digits = 0;
++ _M_data->_M_pos_format = money_base::_S_default_pattern;
++ _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++ _M_data->_M_atoms[__i] =
++ static_cast<wchar_t>(money_base::_S_atoms[__i]);
++ }
++ else
++ {
++ // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __c_locale __old = __uselocale(__cloc);
++#else
++ // Switch to named locale so that mbsrtowcs will work.
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++#endif
++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++ wchar_t* __wcs_ps = 0;
++ wchar_t* __wcs_ns = 0;
++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++ try
++ {
++ mbstate_t __state;
++ size_t __len;
++ __len = strlen(__cpossign);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ps = new wchar_t[__len];
++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++ _M_data->_M_positive_sign = __wcs_ps;
++ }
++ else
++ _M_data->_M_positive_sign = L"";
++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++ __len = strlen(__cnegsign);
++ if (!__nposn)
++ _M_data->_M_negative_sign = L"()";
++ else if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ __wcs_ns = new wchar_t[__len];
++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++ _M_data->_M_negative_sign = __wcs_ns;
++ }
++ else
++ _M_data->_M_negative_sign = L"";
++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++ // _Intl == true.
++ __len = strlen(__ccurr);
++ if (__len)
++ {
++ ++__len;
++ memset(&__state, 0, sizeof(mbstate_t));
++ wchar_t* __wcs = new wchar_t[__len];
++ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++ _M_data->_M_curr_symbol = __wcs;
++ }
++ else
++ _M_data->_M_curr_symbol = L"";
++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++ }
++ catch (...)
++ {
++ delete _M_data;
++ _M_data = 0;
++ delete __wcs_ps;
++ delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ __throw_exception_again;
++ }
++
++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++ __pposn);
++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++ __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __uselocale(__old);
++#else
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ }
++ }
++
++ template<>
++ moneypunct<wchar_t, true>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++
++ template<>
++ moneypunct<wchar_t, false>::~moneypunct()
++ {
++ if (_M_data->_M_positive_sign_size)
++ delete [] _M_data->_M_positive_sign;
++ if (_M_data->_M_negative_sign_size
++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++ delete [] _M_data->_M_negative_sign;
++ if (_M_data->_M_curr_symbol_size)
++ delete [] _M_data->_M_curr_symbol;
++ delete _M_data;
++ }
++#endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = '.';
++ _M_data->_M_thousands_sep = ',';
++
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++ }
++ else
++ {
++ // Named locale.
++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++ __cloc));
++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++ __cloc));
++
++ // Check for NULL, which implies no grouping.
++ if (_M_data->_M_thousands_sep == '\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = "true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = "false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<char>::~numpunct()
++ { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __numpunct_cache<wchar_t>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_data->_M_grouping = "";
++ _M_data->_M_grouping_size = 0;
++ _M_data->_M_use_grouping = false;
++
++ _M_data->_M_decimal_point = L'.';
++ _M_data->_M_thousands_sep = L',';
++
++ // Use ctype::widen code without the facet...
++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++ _M_data->_M_atoms_out[__i] =
++ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++ _M_data->_M_atoms_in[__j] =
++ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++ }
++ else
++ {
++ // Named locale.
++ // NB: In the GNU model wchar_t is always 32 bit wide.
++ union { char *__s; wchar_t __w; } __u;
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++ _M_data->_M_decimal_point = __u.__w;
++
++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++ _M_data->_M_thousands_sep = __u.__w;
++
++ if (_M_data->_M_thousands_sep == L'\0')
++ _M_data->_M_grouping = "";
++ else
++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++ }
++
++ // NB: There is no way to extact this info from posix locales.
++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++ _M_data->_M_truename = L"true";
++ _M_data->_M_truename_size = 4;
++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++ _M_data->_M_falsename = L"false";
++ _M_data->_M_falsename_size = 5;
++ }
++
++ template<>
++ numpunct<wchar_t>::~numpunct()
++ { delete _M_data; }
++ #endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L) nl_langinfo((N))
++#endif
++
++namespace std
++{
++ template<>
++ void
++ __timepunct<char>::
++ _M_put(char* __s, size_t __maxlen, const char* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = strftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = '\0';
++ }
++
++ template<>
++ void
++ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<char>;
++
++ if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = "%m/%d/%y";
++ _M_data->_M_date_era_format = "%m/%d/%y";
++ _M_data->_M_time_format = "%H:%M:%S";
++ _M_data->_M_time_era_format = "%H:%M:%S";
++ _M_data->_M_date_time_format = "";
++ _M_data->_M_date_time_era_format = "";
++ _M_data->_M_am = "AM";
++ _M_data->_M_pm = "PM";
++ _M_data->_M_am_pm_format = "";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = "Sunday";
++ _M_data->_M_day2 = "Monday";
++ _M_data->_M_day3 = "Tuesday";
++ _M_data->_M_day4 = "Wednesday";
++ _M_data->_M_day5 = "Thursday";
++ _M_data->_M_day6 = "Friday";
++ _M_data->_M_day7 = "Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = "Sun";
++ _M_data->_M_aday2 = "Mon";
++ _M_data->_M_aday3 = "Tue";
++ _M_data->_M_aday4 = "Wed";
++ _M_data->_M_aday5 = "Thu";
++ _M_data->_M_aday6 = "Fri";
++ _M_data->_M_aday7 = "Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = "January";
++ _M_data->_M_month02 = "February";
++ _M_data->_M_month03 = "March";
++ _M_data->_M_month04 = "April";
++ _M_data->_M_month05 = "May";
++ _M_data->_M_month06 = "June";
++ _M_data->_M_month07 = "July";
++ _M_data->_M_month08 = "August";
++ _M_data->_M_month09 = "September";
++ _M_data->_M_month10 = "October";
++ _M_data->_M_month11 = "November";
++ _M_data->_M_month12 = "December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = "Jan";
++ _M_data->_M_amonth02 = "Feb";
++ _M_data->_M_amonth03 = "Mar";
++ _M_data->_M_amonth04 = "Apr";
++ _M_data->_M_amonth05 = "May";
++ _M_data->_M_amonth06 = "Jun";
++ _M_data->_M_amonth07 = "Jul";
++ _M_data->_M_amonth08 = "Aug";
++ _M_data->_M_amonth09 = "Sep";
++ _M_data->_M_amonth10 = "Oct";
++ _M_data->_M_amonth11 = "Nov";
++ _M_data->_M_amonth12 = "Dec";
++ }
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++ __cloc);
++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++ }
++ }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++ template<>
++ void
++ __timepunct<wchar_t>::
++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++ const tm* __tm) const
++ {
++#ifdef __UCLIBC_HAS_XLOCALE__
++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++ _M_c_locale_timepunct);
++#else
++ char* __old = strdup(setlocale(LC_ALL, NULL));
++ setlocale(LC_ALL, _M_name_timepunct);
++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++ setlocale(LC_ALL, __old);
++ free(__old);
++#endif
++ // Make sure __s is null terminated.
++ if (__len == 0)
++ __s[0] = L'\0';
++ }
++
++ template<>
++ void
++ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++ {
++ if (!_M_data)
++ _M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++// if (!__cloc)
++ {
++ // "C" locale
++ _M_c_locale_timepunct = _S_get_c_locale();
++
++ _M_data->_M_date_format = L"%m/%d/%y";
++ _M_data->_M_date_era_format = L"%m/%d/%y";
++ _M_data->_M_time_format = L"%H:%M:%S";
++ _M_data->_M_time_era_format = L"%H:%M:%S";
++ _M_data->_M_date_time_format = L"";
++ _M_data->_M_date_time_era_format = L"";
++ _M_data->_M_am = L"AM";
++ _M_data->_M_pm = L"PM";
++ _M_data->_M_am_pm_format = L"";
++
++ // Day names, starting with "C"'s Sunday.
++ _M_data->_M_day1 = L"Sunday";
++ _M_data->_M_day2 = L"Monday";
++ _M_data->_M_day3 = L"Tuesday";
++ _M_data->_M_day4 = L"Wednesday";
++ _M_data->_M_day5 = L"Thursday";
++ _M_data->_M_day6 = L"Friday";
++ _M_data->_M_day7 = L"Saturday";
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ _M_data->_M_aday1 = L"Sun";
++ _M_data->_M_aday2 = L"Mon";
++ _M_data->_M_aday3 = L"Tue";
++ _M_data->_M_aday4 = L"Wed";
++ _M_data->_M_aday5 = L"Thu";
++ _M_data->_M_aday6 = L"Fri";
++ _M_data->_M_aday7 = L"Sat";
++
++ // Month names, starting with "C"'s January.
++ _M_data->_M_month01 = L"January";
++ _M_data->_M_month02 = L"February";
++ _M_data->_M_month03 = L"March";
++ _M_data->_M_month04 = L"April";
++ _M_data->_M_month05 = L"May";
++ _M_data->_M_month06 = L"June";
++ _M_data->_M_month07 = L"July";
++ _M_data->_M_month08 = L"August";
++ _M_data->_M_month09 = L"September";
++ _M_data->_M_month10 = L"October";
++ _M_data->_M_month11 = L"November";
++ _M_data->_M_month12 = L"December";
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ _M_data->_M_amonth01 = L"Jan";
++ _M_data->_M_amonth02 = L"Feb";
++ _M_data->_M_amonth03 = L"Mar";
++ _M_data->_M_amonth04 = L"Apr";
++ _M_data->_M_amonth05 = L"May";
++ _M_data->_M_amonth06 = L"Jun";
++ _M_data->_M_amonth07 = L"Jul";
++ _M_data->_M_amonth08 = L"Aug";
++ _M_data->_M_amonth09 = L"Sep";
++ _M_data->_M_amonth10 = L"Oct";
++ _M_data->_M_amonth11 = L"Nov";
++ _M_data->_M_amonth12 = L"Dec";
++ }
++#if 0
++ else
++ {
++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++ union { char *__s; wchar_t *__w; } __u;
++
++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++ _M_data->_M_date_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++ _M_data->_M_date_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++ _M_data->_M_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++ _M_data->_M_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++ _M_data->_M_date_time_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++ _M_data->_M_date_time_era_format = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++ _M_data->_M_am = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++ _M_data->_M_pm = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++ _M_data->_M_am_pm_format = __u.__w;
++
++ // Day names, starting with "C"'s Sunday.
++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++ _M_data->_M_day1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++ _M_data->_M_day2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++ _M_data->_M_day3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++ _M_data->_M_day4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++ _M_data->_M_day5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++ _M_data->_M_day6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++ _M_data->_M_day7 = __u.__w;
++
++ // Abbreviated day names, starting with "C"'s Sun.
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++ _M_data->_M_aday1 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++ _M_data->_M_aday2 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++ _M_data->_M_aday3 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++ _M_data->_M_aday4 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++ _M_data->_M_aday5 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++ _M_data->_M_aday6 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++ _M_data->_M_aday7 = __u.__w;
++
++ // Month names, starting with "C"'s January.
++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++ _M_data->_M_month01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++ _M_data->_M_month02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++ _M_data->_M_month03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++ _M_data->_M_month04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++ _M_data->_M_month05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++ _M_data->_M_month06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++ _M_data->_M_month07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++ _M_data->_M_month08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++ _M_data->_M_month09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++ _M_data->_M_month10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++ _M_data->_M_month11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++ _M_data->_M_month12 = __u.__w;
++
++ // Abbreviated month names, starting with "C"'s Jan.
++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++ _M_data->_M_amonth01 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++ _M_data->_M_amonth02 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++ _M_data->_M_amonth03 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++ _M_data->_M_amonth04 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++ _M_data->_M_amonth05 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++ _M_data->_M_amonth06 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++ _M_data->_M_amonth07 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++ _M_data->_M_amonth08 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++ _M_data->_M_amonth09 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++ _M_data->_M_amonth10 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++ _M_data->_M_amonth11 = __u.__w;
++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++ _M_data->_M_amonth12 = __u.__w;
++ }
++#endif // 0
++ }
++#endif
++}
+--- gcc/libstdc++-v3/config/locale/uclibc/time_members.h
++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
++// any later version.
++
++// This library 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 library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(_S_get_c_name())
++ { _M_initialize_timepunct(); }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++ size_t __refs)
++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++ _M_name_timepunct(__s)
++ {
++ char* __tmp = new char[std::strlen(__s) + 1];
++ std::strcpy(__tmp, __s);
++ _M_name_timepunct = __tmp;
++ _M_initialize_timepunct(__cloc);
++ }
++
++ template<typename _CharT>
++ __timepunct<_CharT>::~__timepunct()
++ {
++ if (_M_name_timepunct != _S_get_c_name())
++ delete [] _M_name_timepunct;
++ delete _M_data;
++ _S_destroy_c_locale(_M_c_locale_timepunct);
++ }
+--- gcc/libstdc++-v3/configure
++++ gcc/libstdc++-v3/configure
+@@ -5764,7 +5764,7 @@
+ enableval="$enable_clocale"
+
+ case "$enableval" in
+- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
+ echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
+ { (exit 1); exit 1; }; } ;;
+@@ -5789,6 +5789,9 @@
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ linux-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -6019,6 +6022,76 @@
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ echo "$as_me:$LINENO: result: uclibc" >&5
++echo "${ECHO_T}uclibc" >&6
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$check_msgfmt"; then
++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_check_msgfmt="yes"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
++echo "${ECHO_T}$check_msgfmt" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++ done
++
++
++
++ CLOCALE_H=config/locale/uclibc/c_locale.h
++ CLOCALE_CC=config/locale/uclibc/c_locale.cc
++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++ CMESSAGES_H=config/locale/uclibc/messages_members.h
++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++ CMONEY_CC=config/locale/uclibc/monetary_members.cc
++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++ CTIME_H=config/locale/uclibc/time_members.h
++ CTIME_CC=config/locale/uclibc/time_members.cc
++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++ ;;
+ esac
+
+ # This is where the testsuite looks for locale catalogs, using the
+--- gcc/libstdc++-v3/include/c_compatibility/wchar.h
++++ gcc/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+--- gcc/libstdc++-v3/include/c_std/std_cwchar.h
++++ gcc/libstdc++-v3/include/c_std/std_cwchar.h
+@@ -182,7 +182,9 @@
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using ::wcsftime;
++#endif
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
diff --git a/packages/gcc/gcc-4.2.2/203-uclibc-locale-no__x.patch b/packages/gcc/gcc-4.2.2/203-uclibc-locale-no__x.patch
new file mode 100644
index 0000000000..6ba47003b3
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/203-uclibc-locale-no__x.patch
@@ -0,0 +1,213 @@
+--- gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2006-03-10 15:32:37 +0100
+@@ -60,4 +60,49 @@
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l iswctype_l
++# define __towlower_l towlower_l
++# define __towupper_l towupper_l
++# define __wcscoll_l wcscoll_l
++# define __wcsftime_l wcsftime_l
++# define __wcsxfrm_l wcsxfrm_l
++# define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L) nl_langinfo((N))
++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
++# define __strtod_l(S, E, L) strtod((S), (E))
++# define __strtof_l(S, E, L) strtof((S), (E))
++# define __strtold_l(S, E, L) strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c) NULL
++# define __freelocale(a) ((void)0)
++# define __duplocale(a) __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++# define __iswctype_l(C, M, L) iswctype((C), (M))
++# define __towlower_l(C, L) towlower((C))
++# define __towupper_l(C, L) towupper((C))
++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
++# define __wctype_l(S, L) wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2006-03-10 15:32:37 +0100
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L) strtof((S), (E))
+-#define __strtod_l(S, E, L) strtod((S), (E))
+-#define __strtold_l(S, E, L) strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c) NULL
+-#define __freelocale(a) ((void)0)
+-#define __duplocale(a) __c_locale()
+-#endif
+-
+ namespace std
+ {
+ template<>
+--- gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/collate_members.cc 2006-03-10 15:32:37 +0100
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+ // These are basically extensions to char_traits, and perhaps should
+--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-10 15:32:37 +0100
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+ // Construct and return valid pattern consisting of some combination of:
+--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-10 15:32:37 +0100
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--- gcc/libstdc++-v3/config/locale/uclibc/time_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.cc 2006-03-10 15:32:37 +0100
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L) nl_langinfo((N))
+-#endif
+
+ namespace std
+ {
+--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2006-03-10 15:32:37 +0100
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L) wctype((S))
+-#define __towupper_l(C, L) towupper((C))
+-#define __towlower_l(C, L) towlower((C))
+-#define __iswctype_l(C, M, L) iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+ // NB: The other ctype<char> specializations are in src/locale.cc and
+--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.cc 2006-03-10 15:32:37 +0100
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+- const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+
+--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-03-10 15:32:37 +0100
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+- const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D) ((void)0)
+-#define __bindtextdomain(D,P) ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D) ((void)0)
++#define bindtextdomain(D,P) ((void)0)
+ #endif
+
+ // Non-virtual member functions.
+@@ -70,7 +66,7 @@
+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ const char* __dir) const
+ {
+- __bindtextdomain(__s.c_str(), __dir);
++ bindtextdomain(__s.c_str(), __dir);
+ return this->do_open(__s, __loc);
+ }
+
+@@ -90,7 +86,7 @@
+ {
+ // No error checking is done, assume the catalog exists and can
+ // be used.
+- __textdomain(__s.c_str());
++ textdomain(__s.c_str());
+ return 0;
+ }
+
+--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.h.uclibc200no__x~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.h 2006-03-10 15:32:37 +0100
+@@ -68,6 +68,7 @@
+ {
+ extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+
+ namespace std
diff --git a/packages/gcc/gcc-4.2.2/204-uclibc-locale-wchar_fix.patch b/packages/gcc/gcc-4.2.2/204-uclibc-locale-wchar_fix.patch
new file mode 100644
index 0000000000..160ab35bb3
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/204-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,48 @@
+--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-10 15:37:27 +0100
+@@ -401,7 +401,7 @@
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_wchar~ 2006-03-10 15:32:37 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-10 15:37:27 +0100
+@@ -127,12 +127,25 @@
+ {
+ // Named locale.
+ // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ union { char *__s; wchar_t __w; } __u;
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ _M_data->_M_decimal_point = __u.__w;
+
+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ _M_data->_M_thousands_sep = __u.__w;
++#endif
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
diff --git a/packages/gcc/gcc-4.2.2/205-uclibc-locale-update.patch b/packages/gcc/gcc-4.2.2/205-uclibc-locale-update.patch
new file mode 100644
index 0000000000..86b2844554
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/205-uclibc-locale-update.patch
@@ -0,0 +1,347 @@
+--- gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc.uclibc200_update~ 2006-03-10 15:32:37 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2006-03-10 15:39:14 +0100
+@@ -46,16 +47,13 @@
+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- float __f = __strtof_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __f;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ float __f = __strtof_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __f;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -63,16 +61,13 @@
+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- double __d = __strtod_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __d;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ double __d = __strtod_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __d;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ template<>
+@@ -80,16 +75,13 @@
+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ const __c_locale& __cloc)
+ {
+- if (!(__err & ios_base::failbit))
+- {
+- char* __sanity;
+- errno = 0;
+- long double __ld = __strtold_l(__s, &__sanity, __cloc);
+- if (__sanity != __s && errno != ERANGE)
+- __v = __ld;
+- else
+- __err |= ios_base::failbit;
+- }
++ char* __sanity;
++ errno = 0;
++ long double __ld = __strtold_l(__s, &__sanity, __cloc);
++ if (__sanity != __s && errno != ERANGE)
++ __v = __ld;
++ else
++ __err |= ios_base::failbit;
+ }
+
+ void
+@@ -110,7 +102,7 @@
+ void
+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+ {
+- if (_S_get_c_locale() != __cloc)
++ if (__cloc && _S_get_c_locale() != __cloc)
+ __freelocale(__cloc);
+ }
+
+--- gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc.uclibc200_update~ 2006-03-10 15:32:37 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2006-03-10 15:39:14 +0100
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ namespace std
+@@ -138,20 +143,34 @@
+ ctype<wchar_t>::
+ do_is(mask __m, wchar_t __c) const
+ {
+- // Highest bitmask in ctype_base == 10, but extra in "C"
+- // library for blank.
++ // The case of __m == ctype_base::space is particularly important,
++ // due to its use in many istream functions. Therefore we deal with
++ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++ // is the mask corresponding to ctype_base::space. NB: an encoding
++ // change would not affect correctness!
+ bool __ret = false;
+- const size_t __bitmasksize = 11;
+- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+- if (__m & _M_bit[__bitcur]
+- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+- {
+- __ret = true;
+- break;
+- }
++ if (__m == _M_bit[5])
++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++ else
++ {
++ // Highest bitmask in ctype_base == 10, but extra in "C"
++ // library for blank.
++ const size_t __bitmasksize = 11;
++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++ if (__m & _M_bit[__bitcur])
++ {
++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++ {
++ __ret = true;
++ break;
++ }
++ else if (__m == _M_bit[__bitcur])
++ break;
++ }
++ }
+ return __ret;
+ }
+-
++
+ const wchar_t*
+ ctype<wchar_t>::
+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
+--- gcc/libstdc++-v3/config/locale/uclibc/messages_members.h.uclibc200_update~ 2006-03-10 15:32:37 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-03-10 15:39:14 +0100
+@@ -47,18 +47,21 @@
+ template<typename _CharT>
+ messages<_CharT>::messages(size_t __refs)
+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
+- _M_name_messages(_S_get_c_name())
++ _M_name_messages(_S_get_c_name())
+ { }
+
+ template<typename _CharT>
+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ size_t __refs)
+- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+- _M_name_messages(__s)
++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_messages = __tmp;
++
++ // Last to avoid leaking memory if new throws.
++ _M_c_locale_messages = _S_clone_c_locale(__cloc);
+ }
+
+ template<typename _CharT>
+--- gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc.uclibc200_update~ 2006-03-10 15:37:27 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-10 15:39:14 +0100
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@
+ }
+ break;
+ default:
+- ;
++ __ret = pattern();
+ }
+ return __ret;
+ }
+--- gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc.uclibc200_update~ 2006-03-10 15:37:27 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-10 15:39:14 +0100
+@@ -33,9 +33,14 @@
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+--- gcc/libstdc++-v3/config/locale/uclibc/time_members.h.uclibc200_update~ 2006-03-10 15:06:17 +0100
++++ gcc/libstdc++-v3/config/locale/uclibc/time_members.h 2006-03-10 15:39:14 +0100
+@@ -37,25 +37,33 @@
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(_S_get_c_name())
++ _M_name_timepunct(_S_get_c_name())
+ { _M_initialize_timepunct(); }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(_S_get_c_name())
++ _M_name_timepunct(_S_get_c_name())
+ { _M_initialize_timepunct(); }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+- _M_name_timepunct(__s)
++ _M_name_timepunct(NULL)
+ {
+- char* __tmp = new char[std::strlen(__s) + 1];
+- std::strcpy(__tmp, __s);
++ const size_t __len = std::strlen(__s) + 1;
++ char* __tmp = new char[__len];
++ std::memcpy(__tmp, __s, __len);
+ _M_name_timepunct = __tmp;
+- _M_initialize_timepunct(__cloc);
++
++ try
++ { _M_initialize_timepunct(__cloc); }
++ catch(...)
++ {
++ delete [] _M_name_timepunct;
++ __throw_exception_again;
++ }
+ }
+
+ template<typename _CharT>
+--- gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h.old 2006-09-28 11:39:00.000000000 +0200
++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2006-09-28 12:10:41.000000000 +0200
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+
+ #include <cstring> // get std::strlen
+-#include <cstdio> // get std::snprintf or std::sprintf
++#include <cstdio> // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h> // For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h> // For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> // For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h> // For messages
+ #endif
++#include <cstdarg>
+
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+
+@@ -62,7 +64,7 @@
+ #endif
+ // #define _GLIBCXX_NUM_CATEGORIES 6
+ #define _GLIBCXX_NUM_CATEGORIES 0
+-
++
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ namespace __gnu_cxx
+ {
+@@ -79,22 +81,24 @@
+ typedef int* __c_locale;
+ #endif
+
+- // Convert numeric value of type _Tv to string and return length of
+- // string. If snprintf is available use it, otherwise fall back to
+- // the unsafe sprintf which, in general, can be dangerous and should
++ // Convert numeric value of type double to string and return length of
++ // string. If vsnprintf is available use it, otherwise fall back to
++ // the unsafe vsprintf which, in general, can be dangerous and should
+ // be avoided.
+- template<typename _Tv>
+- int
+- __convert_from_v(char* __out,
+- const int __size __attribute__ ((__unused__)),
+- const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+- _Tv __v, const __c_locale& __cloc, int __prec)
++ inline int
++ __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++ __cloc __attribute__ ((__unused__))
++#endif
++ ,
++ char* __out,
++ const int __size,
++ const char* __fmt, ...)
+ {
++ va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+- _Tv __v, const __c_locale&, int __prec)
+- {
+ # ifdef __UCLIBC_HAS_LOCALE__
+ char* __old = std::setlocale(LC_ALL, NULL);
+ char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@
+ # endif
+ #endif
+
+- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++ va_start(__args, __fmt);
++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++ va_end(__args);
+
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+ __gnu_cxx::__uselocale(__old);
diff --git a/packages/gcc/gcc-4.2.2/300-libstdc++-pic.patch b/packages/gcc/gcc-4.2.2/300-libstdc++-pic.patch
new file mode 100644
index 0000000000..89d03a85e5
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/300-libstdc++-pic.patch
@@ -0,0 +1,46 @@
+# DP: Build and install libstdc++_pic.a library.
+
+--- gcc-4.1.0/libstdc++-v3/src/Makefile.am 2004-11-15 17:33:05.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.am 2005-04-25 20:05:59.186930896 -0500
+@@ -214,6 +214,10 @@
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+
+
++install-exec-local:
++ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
++
+ # Added bits to build debug library.
+ if GLIBCXX_BUILD_DEBUG
+ all-local: build_debug
+--- gcc-4.1.0/libstdc++-v3/src/Makefile.in 2005-04-11 19:13:08.000000000 -0500
++++ gcc-4.1.0-patched/libstdc++-v3/src/Makefile.in 2005-04-25 20:12:33.284316275 -0500
+@@ -627,7 +627,7 @@
+
+ install-data-am: install-data-local
+
+-install-exec-am: install-toolexeclibLTLIBRARIES
++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
+
+ install-info: install-info-am
+
+@@ -660,6 +660,7 @@
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-data-local install-exec \
++ install-exec-local \
+ install-exec-am install-info install-info-am install-man \
+ install-strip install-toolexeclibLTLIBRARIES installcheck \
+ installcheck-am installdirs maintainer-clean \
+@@ -745,6 +746,11 @@
+ install_debug:
+ (cd ${debugdir} && $(MAKE) \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
++
++install-exec-local:
++ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
++
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/packages/gcc/gcc-4.2.2/301-missing-execinfo_h.patch b/packages/gcc/gcc-4.2.2/301-missing-execinfo_h.patch
new file mode 100644
index 0000000000..0e2092f3fb
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/301-missing-execinfo_h.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500
++++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500
+@@ -500,7 +500,7 @@
+ #ifdef __linux__
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/packages/gcc/gcc-4.2.2/302-c99-snprintf.patch b/packages/gcc/gcc-4.2.2/302-c99-snprintf.patch
new file mode 100644
index 0000000000..dfb22d681b
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/302-c99-snprintf.patch
@@ -0,0 +1,11 @@
+--- gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h-orig 2005-04-29 00:08:41.000000000 -0500
++++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cstdio.h 2005-04-29 00:08:45.000000000 -0500
+@@ -142,7 +142,7 @@
+ using ::vsprintf;
+ }
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/packages/gcc/gcc-4.2.2/303-c99-complex-ugly-hack.patch b/packages/gcc/gcc-4.2.2/303-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000000..2ccc80d9bb
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/303-c99-complex-ugly-hack.patch
@@ -0,0 +1,12 @@
+--- gcc-4.0.0/libstdc++-v3/configure-old 2005-04-30 22:04:48.061603912 -0500
++++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 22:06:13.678588152 -0500
+@@ -7194,6 +7194,9 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
diff --git a/packages/gcc/gcc-4.2.2/304-index_macro.patch b/packages/gcc/gcc-4.2.2/304-index_macro.patch
new file mode 100644
index 0000000000..d8e476555d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/304-index_macro.patch
@@ -0,0 +1,24 @@
+--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100
++++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100
+@@ -59,6 +59,9 @@
+ #include <bits/allocator.h>
+ #include <ext/hash_fun.h>
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ # define __GC_CONST const
+ # else
+--- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100
++++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100
+@@ -53,6 +53,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+ using std::size_t;
diff --git a/packages/gcc/gcc-4.2.2/305-libmudflap-susv3-legacy.patch b/packages/gcc/gcc-4.2.2/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000000..374b1f8659
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.2/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834)
++++ gcc-4.2/libmudflap/mf-hooks2.c (working copy)
+@@ -427,7 +427,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -437,7 +437,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -447,7 +447,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -456,7 +456,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -465,7 +465,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/packages/gcc/gcc-4.2.2/306-libstdc++-namespace.patch b/packages/gcc/gcc-4.2.2/306-libstdc++-namespace.patch
new file mode 100644
index 0000000000..69587ca63a
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/306-libstdc++-namespace.patch
@@ -0,0 +1,36 @@
+diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
+--- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-12-22 13:06:56.000000000 +0100
++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-12-22 15:23:41.000000000 +0100
+@@ -32,7 +32,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+@@ -115,3 +116,4 @@
+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ }
+ }
++}
+diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h
+--- gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2006-12-22 13:06:56.000000000 +0100
++++ gcc-4.2/libstdc++-v3/config/locale/uclibc/time_members.h 2006-12-22 15:20:31.000000000 +0100
+@@ -33,7 +33,8 @@
+ //
+
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(size_t __refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+@@ -74,3 +75,4 @@
+ delete _M_data;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
++}
diff --git a/packages/gcc/gcc-4.2.2/307-locale_facets.patch b/packages/gcc/gcc-4.2.2/307-locale_facets.patch
new file mode 100644
index 0000000000..412f8657dc
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/307-locale_facets.patch
@@ -0,0 +1,26 @@
+This patch fixes a bug into ostream::operator<<(double) due to the wrong size
+passed into the __convert_from_v method. The wrong size is then passed to
+std::snprintf function, that, on uClibc, doens't handle sized 0 buffer.
+
+Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
+
+--- gcc-4.2.1/libstdc++-v3/include/bits/locale_facets.tcc 2006-10-17 18:43:47.000000000 +0200
++++ gcc-4.2.1-st/libstdc++-v3/include/bits/locale_facets.tcc 2007-08-22 18:54:23.000000000 +0200
+@@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
+ const int __cs_size = __fixed ? __max_exp + __prec + 4
+ : __max_digits * 2 + __prec;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+- __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
++ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf,
+ __prec, __v);
+ #endif
+
+@@ -1777,7 +1777,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
+ // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
+ const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+- int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
++ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf",
+ 0, __units);
+ #endif
+ string_type __digits(__len, char_type());
diff --git a/packages/gcc/gcc-4.2.2/402-libbackend_dep_gcov-iov.h.patch b/packages/gcc/gcc-4.2.2/402-libbackend_dep_gcov-iov.h.patch
new file mode 100644
index 0000000000..0bf115c45d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/402-libbackend_dep_gcov-iov.h.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.2/gcc/Makefile.in
+===================================================================
+--- gcc-4.2/gcc/Makefile.in (revision 121758)
++++ gcc-4.2/gcc/Makefile.in (working copy)
+@@ -2658,7 +2658,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H)
+ # FIXME: writing proper dependencies for this is a *LOT* of work.
+ libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
+ insn-config.h insn-flags.h insn-codes.h insn-constants.h \
+- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
++ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+ -DTARGET_NAME=\"$(target_noncanonical)\" \
+ -DLOCALEDIR=\"$(localedir)\" \
diff --git a/packages/gcc/gcc-4.2.2/602-sdk-libstdc++-includes.patch b/packages/gcc/gcc-4.2.2/602-sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..23fce7544d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/602-sdk-libstdc++-includes.patch
@@ -0,0 +1,20 @@
+--- gcc-4.1.0/libstdc++-v3/fragment.am 2005-03-21 11:40:14.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/fragment.am 2005-04-25 20:14:39.856251785 -0500
+@@ -21,5 +21,5 @@
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+ # -I/-D flags to pass when compiling.
+-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
+
+--- gcc-4.1.0/libstdc++-v3/libmath/Makefile.am 2005-03-21 11:40:18.000000000 -0600
++++ gcc-4.1.0-patched/libstdc++-v3/libmath/Makefile.am 2005-04-25 20:14:39.682280735 -0500
+@@ -35,7 +35,7 @@
+
+ libmath_la_SOURCES = stubs.c
+
+-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
+
+ # Only compiling "C" sources in this directory.
+ LIBTOOL = @LIBTOOL@ --tag CC
diff --git a/packages/gcc/gcc-4.2.2/740-sh-pr24836.patch b/packages/gcc/gcc-4.2.2/740-sh-pr24836.patch
new file mode 100644
index 0000000000..7992282cff
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/740-sh-pr24836.patch
@@ -0,0 +1,25 @@
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+
+--- gcc/gcc/configure.ac (revision 106699)
++++ gcc/gcc/configure.ac (working copy)
+@@ -2446,7 +2446,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
+--- gcc/gcc/configure
++++ gcc/gcc/configure
+@@ -14846,7 +14846,7 @@
+ tls_first_minor=14
+ tls_as_opt="-m64 -Aesame --fatal-warnings"
+ ;;
+- sh-*-* | sh[34]-*-*)
++ sh-*-* | sh[34]*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+ foo: .long 25
diff --git a/packages/gcc/gcc-4.2.2/800-arm-bigendian.patch b/packages/gcc/gcc-4.2.2/800-arm-bigendian.patch
new file mode 100644
index 0000000000..07c6093379
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/800-arm-bigendian.patch
@@ -0,0 +1,67 @@
+By Lennert Buytenhek <buytenh@wantstofly.org>
+Adds support for arm*b-linux* big-endian ARM targets
+
+See http://gcc.gnu.org/PR16350
+
+--- gcc-4.2.0/gcc/config/arm/linux-elf.h
++++ gcc-4.2.0/gcc/config/arm/linux-elf.h
+@@ -28,19 +28,33 @@
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+
++/*
++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
++ * (big endian) configurations.
++ */
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
++#define TARGET_ENDIAN_OPTION "mbig-endian"
++#define TARGET_LINKER_EMULATION "armelfb_linux"
++#else
++#define TARGET_ENDIAN_DEFAULT 0
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#define TARGET_LINKER_EMULATION "armelf_linux"
++#endif
++
+ #undef TARGET_DEFAULT_FLOAT_ABI
+ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+
+ #undef TARGET_DEFAULT
+-#define TARGET_DEFAULT (0)
++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
+
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
+
+ #undef MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
+
+ /* Now we define the strings used to build the spec file. */
+ #undef LIB_SPEC
+@@ -61,7 +75,7 @@
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
+ -X \
+- %{mbig-endian:-EB}" \
++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
+ SUBTARGET_EXTRA_LINK_SPEC
+
+ #undef LINK_SPEC
+--- gcc-4.2.0/gcc/config.gcc.orig 2006-09-22 14:53:41.000000000 +0200
++++ gcc-4.2.0/gcc/config.gcc 2006-09-25 10:45:21.000000000 +0200
+@@ -696,6 +696,11 @@
+ tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+ tmake_file="${tmake_file} t-linux arm/t-arm"
+ case ${target} in
++ arm*b-*)
++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
++ ;;
++ esac
++ case ${target} in
+ arm*-*-linux-*eabi)
+ tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+ tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
diff --git a/packages/gcc/gcc-4.2.2/801-arm-bigendian-eabi.patch b/packages/gcc/gcc-4.2.2/801-arm-bigendian-eabi.patch
new file mode 100644
index 0000000000..54490fc24f
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/801-arm-bigendian-eabi.patch
@@ -0,0 +1,14 @@
+Index: gcc-4.1.1/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.1.1.orig/gcc/config/arm/linux-eabi.h 2007-02-20 14:51:33.416193250 +0100
++++ gcc-4.1.1/gcc/config/arm/linux-eabi.h 2007-02-20 14:52:11.622581000 +0100
+@@ -48,7 +48,8 @@
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
++#define SUBTARGET_EXTRA_LINK_SPEC \
++ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
+
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
diff --git a/packages/gcc/gcc-4.2.2/904-flatten-switch-stmt-00.patch b/packages/gcc/gcc-4.2.2/904-flatten-switch-stmt-00.patch
new file mode 100644
index 0000000000..8fac37c4df
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/904-flatten-switch-stmt-00.patch
@@ -0,0 +1,153 @@
+Hi,
+
+The attached patch makes sure that we create smaller object code for
+simple switch statements. We just make sure to flatten the switch
+statement into an if-else chain, basically.
+
+This fixes a size-regression as compared to gcc-3.4, as can be seen
+below.
+
+2007-04-15 Bernhard Fischer <..>
+
+ * stmt.c (expand_case): Do not create a complex binary tree when
+ optimizing for size but rather use the simple ordered list.
+ (emit_case_nodes): do not emit jumps to the default_label when
+ optimizing for size.
+
+Not regtested so far.
+Comments?
+
+Attached is the test switch.c mentioned below.
+
+$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
+gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
+$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
+gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
+
+$ size switch-*.o
+ text data bss dec hex filename
+ 169 0 0 169 a9 switch-2.95.o
+ 115 0 0 115 73 switch-3.3.o
+ 103 0 0 103 67 switch-3.4.o
+ 124 0 0 124 7c switch-4.0.o
+ 124 0 0 124 7c switch-4.1.o
+ 124 0 0 124 7c switch-4.2.orig-HEAD.o
+ 95 0 0 95 5f switch-4.3-HEAD.o
+ 124 0 0 124 7c switch-4.3.orig-HEAD.o
+ 166 0 0 166 a6 switch-CHAIN-2.95.o
+ 111 0 0 111 6f switch-CHAIN-3.3.o
+ 95 0 0 95 5f switch-CHAIN-3.4.o
+ 95 0 0 95 5f switch-CHAIN-4.0.o
+ 95 0 0 95 5f switch-CHAIN-4.1.o
+ 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
+ 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
+ 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
+
+
+Content-Type: text/x-diff; charset=us-ascii
+Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
+
+Index: gcc-4.2.0/gcc/stmt.c
+===================================================================
+--- gcc-4.2.0.orig/gcc/stmt.c (revision 123843)
++++ gcc-4.2.0/gcc/stmt.c (working copy)
+@@ -2517,7 +2517,11 @@ expand_case (tree exp)
+ use_cost_table
+ = (TREE_CODE (orig_type) != ENUMERAL_TYPE
+ && estimate_case_costs (case_list));
+- balance_case_nodes (&case_list, NULL);
++ /* When optimizing for size, we want a straight list to avoid
++ jumps as much as possible. This basically creates an if-else
++ chain. */
++ if (!optimize_size)
++ balance_case_nodes (&case_list, NULL);
+ emit_case_nodes (index, case_list, default_label, index_type);
+ emit_jump (default_label);
+ }
+@@ -3075,6 +3079,7 @@ emit_case_nodes (rtx index, case_node_pt
+ {
+ if (!node_has_low_bound (node, index_type))
+ {
++ if (!optimize_size) /* don't jl to the .default_label. */
+ emit_cmp_and_jump_insns (index,
+ convert_modes
+ (mode, imode,
+
+
+Content-Type: text/x-csrc; charset=us-ascii
+Content-Disposition: attachment; filename="switch.c"
+
+int
+commutative_tree_code (int code)
+{
+#define CASE(val, ret) case val:/* __asm__("# val="#val ",ret="#ret);*/ return ret;
+#ifndef CHAIN
+ switch (code)
+ {
+# if 1
+ CASE(1,3)
+ CASE(3,2)
+ CASE(5,8)
+ CASE(7,1)
+ CASE(33,4)
+ CASE(44,9)
+ CASE(55,10)
+ CASE(66,-1)
+ CASE(77,99)
+ CASE(666,0)
+# else
+ case 1:
+ return 3;
+ case 3:
+ return 2;
+ case 5:
+ return 8;
+ case 7:
+ return 1;
+ case 33:
+ return 4;
+ case 44:
+ return 9;
+ case 55:
+ return 10;
+ case 66:
+ return -1;
+ case 77:
+ return 99;
+ case 666:
+ return 0;
+# endif
+ default:
+ break;
+ }
+ return 4711;
+
+#else
+ if (code == 1)
+ return 3;
+ else if (code == 3)
+ return 2;
+ else if (code == 5)
+ return 8;
+ else if (code == 7)
+ return 1;
+ else if (code == 33)
+ return 4;
+ else if (code == 44)
+ return 9;
+ else if (code == 55)
+ return 10;
+ else if (code == 66)
+ return -1;
+ else if (code == 77)
+ return 99;
+ else if (code == 666)
+ return 0;
+ else
+ return 4711;
+#endif
+}
+
+
+--AhhlLboLdkugWU4S--
+
diff --git a/packages/gcc/gcc-4.2.2/README b/packages/gcc/gcc-4.2.2/README
new file mode 100644
index 0000000000..b85840dc20
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/README
@@ -0,0 +1,4 @@
+The numbered patches come from
+http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/gcc/4.1.1/
+Other patches are locally added to fix things (mostly inherited and reapplied
+from gcc 3.4.4 where applicable)
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-20000320.patch b/packages/gcc/gcc-4.2.2/arm-crunch-20000320.patch
new file mode 100644
index 0000000000..3fb0da7670
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-20000320.patch
@@ -0,0 +1,11 @@
+--- gcc-4.1.2/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.c.original 2007-06-07 16:33:44.000000000 +1000
++++ gcc-4.1.2/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.c 2007-06-07 16:34:05.000000000 +1000
+@@ -49,7 +49,7 @@
+ exit (0);
+
+ c(0x3690000000000000ULL, 0x00000000U);
+-#if (defined __arm__ || defined __thumb__) && ! (defined __ARMEB__ || defined __VFP_FP__)
++#if (defined __arm__ || defined __thumb__) && ! (defined __ARMEB__ || defined __VFP_FP__) && ! (defined __MAVERICK__)
+ /* The ARM always stores FP numbers in big-wordian format,
+ even when running in little-byteian mode. */
+ c(0x0000000136900000ULL, 0x00000001U);
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-32bit-disable.patch b/packages/gcc/gcc-4.2.2/arm-crunch-32bit-disable.patch
new file mode 100644
index 0000000000..88eaee322d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-32bit-disable.patch
@@ -0,0 +1,85 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-integer 2007-06-15 09:01:37.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-15 09:04:45.000000000 +1000
+@@ -149,7 +149,7 @@
+ (match_operand:SI 1 "cirrus_fp_register" "0")
+ (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v")
+ (match_operand:SI 3 "cirrus_fp_register" "v"))))]
+- "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmsc32%?\\t%V0, %V2, %V3"
+ [(set_attr "type" "mav_farith")
+ (set_attr "cirrus" "normal")]
+@@ -305,7 +305,7 @@
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float:SF (match_operand:SI 1 "s_register_operand" "r")))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "move")]
+@@ -315,7 +315,7 @@
+ [(set (match_operand:DF 0 "cirrus_fp_register" "=v")
+ (float:DF (match_operand:SI 1 "s_register_operand" "r")))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "move")]
+@@ -339,7 +339,7 @@
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v"))))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "normal")]
+@@ -349,7 +349,7 @@
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v"))))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "normal")]
+--- gcc-4.1.2/gcc/config/arm/arm.md-trunc 2007-06-15 10:56:13.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-15 11:01:22.000000000 +1000
+@@ -3130,7 +3130,7 @@
+ (float:SF (match_operand:SI 1 "s_register_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1]));
+ DONE;
+@@ -3142,7 +3142,7 @@
+ (float:DF (match_operand:SI 1 "s_register_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1]));
+ DONE;
+@@ -3154,7 +3154,7 @@
+ (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ if (!cirrus_fp_register (operands[0], SImode))
+ operands[0] = force_reg (SImode, operands[0]);
+@@ -3170,7 +3170,7 @@
+ (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ if (!cirrus_fp_register (operands[1], DFmode))
+ operands[1] = force_reg (DFmode, operands[0]);
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable-4.2.0.patch b/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable-4.2.0.patch
new file mode 100644
index 0000000000..60b17852bd
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable-4.2.0.patch
@@ -0,0 +1,169 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-integer 2007-06-15 09:01:37.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-15 09:04:45.000000000 +1000
+@@ -34,7 +34,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (plus:DI (match_operand:DI 1 "cirrus_fp_register" "v")
+ (match_operand:DI 2 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfadd64%?\\t%V0, %V1, %V2"
+ [(set_attr "type" "mav_farith")
+ (set_attr "cirrus" "normal")]
+@@ -74,7 +74,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (minus:DI (match_operand:DI 1 "cirrus_fp_register" "v")
+ (match_operand:DI 2 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfsub64%?\\t%V0, %V1, %V2"
+ [(set_attr "type" "mav_farith")
+ (set_attr "cirrus" "normal")]
+@@ -124,7 +124,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (mult:DI (match_operand:DI 2 "cirrus_fp_register" "v")
+ (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmul64%?\\t%V0, %V1, %V2"
+ [(set_attr "type" "mav_dmult")
+ (set_attr "cirrus" "normal")]
+@@ -206,7 +206,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v")
+ (match_operand:SI 2 "register_operand" "r")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfrshl64%?\\t%V1, %V0, %s2"
+ [(set_attr "cirrus" "normal")]
+ )
+@@ -215,7 +215,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v")
+ (match_operand:SI 2 "cirrus_shift_const" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfsh64%?\\t%V0, %V1, #%s2"
+ [(set_attr "cirrus" "normal")]
+ )
+@@ -224,7 +224,7 @@
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (ashiftrt:DI (match_operand:DI 1 "cirrus_fp_register" "v")
+ (match_operand:SI 2 "cirrus_shift_const" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfsh64%?\\t%V0, %V1, #-%s2"
+ [(set_attr "cirrus" "normal")]
+ )
+@@ -232,7 +232,7 @@
+ (define_insn "*cirrus_absdi2"
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (abs:DI (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfabs64%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")]
+ )
+@@ -238,11 +238,12 @@
+ )
+
+ ;; This doesn't really clobber ``cc''. Fixme: aldyh.
++;; maybe buggy?
+ (define_insn "*cirrus_negdi2"
+ [(set (match_operand:DI 0 "cirrus_fp_register" "=v")
+ (neg:DI (match_operand:DI 1 "cirrus_fp_register" "v")))
+ (clobber (reg:CC CC_REGNUM))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfneg64%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")]
+ )
+@@ -324,14 +324,14 @@
+ (define_insn "floatdisf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfcvt64s%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
+ (define_insn "floatdidf2"
+ [(set (match_operand:DF 0 "cirrus_fp_register" "=v")
+ (float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfcvt64d%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
+@@ -376,7 +376,7 @@
+ (define_insn "*cirrus_arm_movdi"
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,o<>,v,r,v,m,v")
+ (match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,mi,v,v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "*
+ {
+ switch (which_alternative)
+--- gcc-4.1.2/gcc/config/arm/arm.md-64 2007-06-15 11:37:42.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-15 11:40:45.000000000 +1000
+@@ -357,7 +357,7 @@
+ (clobber (reg:CC CC_REGNUM))])]
+ "TARGET_EITHER"
+ "
+- if (TARGET_HARD_FLOAT && TARGET_MAVERICK)
++ if (TARGET_HARD_FLOAT && TARGET_MAVERICK && 0)
+ {
+ if (!cirrus_fp_register (operands[0], DImode))
+ operands[0] = force_reg (DImode, operands[0]);
+@@ -393,7 +393,7 @@
+ (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0")
+ (match_operand:DI 2 "s_register_operand" "r, 0")))
+ (clobber (reg:CC CC_REGNUM))]
+- "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
++ "TARGET_ARM"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(parallel [(set (reg:CC_C CC_REGNUM)
+@@ -421,7 +421,7 @@
+ (match_operand:SI 2 "s_register_operand" "r,r"))
+ (match_operand:DI 1 "s_register_operand" "r,0")))
+ (clobber (reg:CC CC_REGNUM))]
+- "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
++ "TARGET_ARM"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(parallel [(set (reg:CC_C CC_REGNUM)
+@@ -450,7 +450,7 @@
+ (match_operand:SI 2 "s_register_operand" "r,r"))
+ (match_operand:DI 1 "s_register_operand" "r,0")))
+ (clobber (reg:CC CC_REGNUM))]
+- "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
++ "TARGET_ARM"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(parallel [(set (reg:CC_C CC_REGNUM)
+@@ -838,7 +838,7 @@
+ if (TARGET_HARD_FLOAT && TARGET_MAVERICK
+ && TARGET_ARM
+ && cirrus_fp_register (operands[0], DImode)
+- && cirrus_fp_register (operands[1], DImode))
++ && cirrus_fp_register (operands[1], DImode) && 0)
+ {
+ emit_insn (gen_cirrus_subdi3 (operands[0], operands[1], operands[2]));
+ DONE;
+@@ -2599,7 +2599,7 @@
+ values to iwmmxt regs and back. */
+ FAIL;
+ }
+- else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK))
++ else if (!TARGET_REALLY_IWMMXT)
+ FAIL;
+ "
+ )
+@@ -4215,7 +4215,6 @@
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r")
+ (match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))]
+ "TARGET_THUMB
+- && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)
+ && ( register_operand (operands[0], DImode)
+ || register_operand (operands[1], DImode))"
+ "*
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable0.patch b/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable0.patch
new file mode 100644
index 0000000000..95abf68a60
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-64bit-disable0.patch
@@ -0,0 +1,47 @@
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.md gcc-4.1.2/gcc/config/arm/arm.md
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.md 2006-09-28 03:10:22.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-05-15 09:53:21.000000000 +1000
+@@ -6865,10 +6877,12 @@
+ )
+
+ ;; Cirrus DI compare instruction
++;; This is disabled and left go through ARM core registers, because currently
++;; Crunch coprocessor does only signed comparison.
+ (define_expand "cmpdi"
+ [(match_operand:DI 0 "cirrus_fp_register" "")
+ (match_operand:DI 1 "cirrus_fp_register" "")]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK & 0"
+ "{
+ arm_compare_op0 = operands[0];
+ arm_compare_op1 = operands[1];
+@@ -6879,7 +6893,7 @@
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC (match_operand:DI 0 "cirrus_fp_register" "v")
+ (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK & 0"
+ "cfcmp64%?\\tr15, %V0, %V1"
+ [(set_attr "type" "mav_farith")
+ (set_attr "cirrus" "compare")]
+@@ -10105,6 +10119,7 @@
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "")] UNSPEC_PROLOGUE_USE)]
+ ""
+ "%@ %0 needed for prologue"
++ [(set_attr "length" "0")]
+ )
+
+
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/cirrus.md gcc-4.1.2/gcc/config/arm/cirrus.md
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/cirrus.md 2005-06-25 11:22:41.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-05-15 09:55:29.000000000 +1000
+@@ -348,7 +348,8 @@
+ (clobber (match_scratch:DF 2 "=v"))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
+ "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+- [(set_attr "length" "8")]
++ [(set_attr "length" "8")
++ (set_attr "cirrus" "normal")]
+ )
+
+ (define_insn "*cirrus_truncdfsf2"
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-and-or.patch b/packages/gcc/gcc-4.2.2/arm-crunch-and-or.patch
new file mode 100644
index 0000000000..24357d316e
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-and-or.patch
@@ -0,0 +1,67 @@
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-13 17:16:38.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-13 17:35:19.000000000 +1000
+@@ -8455,7 +8455,7 @@
+ (and:SI (match_operator:SI 1 "arm_comparison_operator"
+ [(match_operand 3 "cc_register" "") (const_int 0)])
+ (match_operand:SI 2 "s_register_operand" "r")))]
+- "TARGET_ARM"
++ "TARGET_ARM && !TARGET_MAVERICK"
+ "mov%D1\\t%0, #0\;and%d1\\t%0, %2, #1"
+ [(set_attr "conds" "use")
+ (set_attr "length" "8")]
+@@ -8466,7 +8466,7 @@
+ (ior:SI (match_operator:SI 2 "arm_comparison_operator"
+ [(match_operand 3 "cc_register" "") (const_int 0)])
+ (match_operand:SI 1 "s_register_operand" "0,?r")))]
+- "TARGET_ARM"
++ "TARGET_ARM && !TARGET_MAVERICK"
+ "@
+ orr%d2\\t%0, %1, #1
+ mov%D2\\t%0, %1\;orr%d2\\t%0, %1, #1"
+@@ -8734,7 +8734,8 @@
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_ARM
+ && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_OR_Y)
+- != CCmode)"
++ != CCmode)
++ && !TARGET_MAVERICK"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(set (match_dup 7)
+@@ -8765,7 +8766,7 @@
+ (set (match_operand:SI 7 "s_register_operand" "=r")
+ (ior:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])
+ (match_op_dup 6 [(match_dup 4) (match_dup 5)])))]
+- "TARGET_ARM"
++ "TARGET_ARM && !TARGET_MAVERICK"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(set (match_dup 0)
+@@ -8790,7 +8791,8 @@
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_ARM
+ && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_AND_Y)
+- != CCmode)"
++ != CCmode)
++ && !TARGET_MAVERICK"
+ "#"
+ "TARGET_ARM && reload_completed
+ && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_AND_Y)
+@@ -8823,7 +8825,7 @@
+ (set (match_operand:SI 7 "s_register_operand" "=r")
+ (and:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])
+ (match_op_dup 6 [(match_dup 4) (match_dup 5)])))]
+- "TARGET_ARM"
++ "TARGET_ARM && !TARGET_MAVERICK"
+ "#"
+ "TARGET_ARM && reload_completed"
+ [(set (match_dup 0)
+@@ -8850,7 +8852,7 @@
+ [(match_operand:SI 4 "s_register_operand" "r,r,r")
+ (match_operand:SI 5 "arm_add_operand" "rIL,rIL,rIL")])))
+ (clobber (reg:CC CC_REGNUM))]
+- "TARGET_ARM
++ "TARGET_ARM && !TARGET_MAVERICK
+ && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_AND_Y)
+ == CCmode)"
+ "#"
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-cfcvt64-disable.patch b/packages/gcc/gcc-4.2.2/arm-crunch-cfcvt64-disable.patch
new file mode 100644
index 0000000000..f9280b18b5
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-cfcvt64-disable.patch
@@ -0,0 +1,19 @@
+--- gcc-4.2.0/gcc/config/arm/cirrus.md-original 2007-06-25 15:32:01.000000000 +1000
++++ gcc-4.2.0/gcc/config/arm/cirrus.md 2007-06-25 15:32:14.000000000 +1000
+@@ -325,14 +325,14 @@
+ (define_insn "floatdisf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfcvt64s%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
+ (define_insn "floatdidf2"
+ [(set (match_operand:DF 0 "cirrus_fp_register" "=v")
+ (float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfcvt64d%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-cfcvtds-disable.patch b/packages/gcc/gcc-4.2.2/arm-crunch-cfcvtds-disable.patch
new file mode 100644
index 0000000000..ec09ea16a1
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-cfcvtds-disable.patch
@@ -0,0 +1,32 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-cfcvt 2007-06-15 10:06:24.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-15 10:07:21.000000000 +1000
+@@ -355,11 +355,12 @@
+ (set_attr "cirrus" "normal")]
+ )
+
++; appears to be buggy - causes 20000320-1.c to fail in execute/ieee
+ (define_insn "*cirrus_truncdfsf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float_truncate:SF
+ (match_operand:DF 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfcvtds%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")]
+ )
+--- gcc-4.1.2/gcc/config/arm/arm.md-truncdfsf2 2007-06-15 10:25:43.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-15 10:27:01.000000000 +1000
+@@ -3181,11 +3181,12 @@
+
+ ;; Truncation insns
+
++;; Maverick Crunch truncdfsf2 is buggy - see cirrus.md
+ (define_expand "truncdfsf2"
+ [(set (match_operand:SF 0 "s_register_operand" "")
+ (float_truncate:SF
+ (match_operand:DF 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ ""
+ )
+
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-cirrus-bugfixes.patch b/packages/gcc/gcc-4.2.2/arm-crunch-cirrus-bugfixes.patch
new file mode 100644
index 0000000000..cb0af8546d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-cirrus-bugfixes.patch
@@ -0,0 +1,573 @@
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c gcc-4.1.2/gcc/config/arm/arm.c
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c 2007-05-09 16:32:29.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-05-15 09:39:41.000000000 +1000
+@@ -4,6 +4,7 @@
+ Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
+ and Martin Simmons (@harleqn.co.uk).
+ More major hacks by Richard Earnshaw (rearnsha@arm.com).
++ Cirrus Crunch bugfixes by Vladimir Ivanov (vladit@nucleusys.com)
+
+ This file is part of GCC.
+
+@@ -131,9 +132,17 @@
+ static bool arm_xscale_rtx_costs (rtx, int, int, int *);
+ static bool arm_9e_rtx_costs (rtx, int, int, int *);
+ static int arm_address_cost (rtx);
+-static bool arm_memory_load_p (rtx);
++// static bool arm_memory_load_p (rtx);
+ static bool arm_cirrus_insn_p (rtx);
+-static void cirrus_reorg (rtx);
++// static void cirrus_reorg (rtx);
++static bool arm_mem_access_p (rtx);
++static bool cirrus_dest_regn_p (rtx, int);
++static rtx cirrus_prev_next_mach_insn (rtx, int *, int);
++static rtx cirrus_prev_mach_insn (rtx, int *);
++static rtx cirrus_next_mach_insn (rtx, int *);
++static void cirrus_reorg_branch (rtx);
++static void cirrus_reorg_bug1 (rtx);
++static void cirrus_reorg_bug10_12 (rtx);
+ static void arm_init_builtins (void);
+ static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+ static void arm_init_iwmmxt_builtins (void);
+@@ -5399,41 +5412,6 @@
+ || TREE_CODE (valtype) == COMPLEX_TYPE));
+ }
+
+-/* Returns TRUE if INSN is an "LDR REG, ADDR" instruction.
+- Use by the Cirrus Maverick code which has to workaround
+- a hardware bug triggered by such instructions. */
+-static bool
+-arm_memory_load_p (rtx insn)
+-{
+- rtx body, lhs, rhs;;
+-
+- if (insn == NULL_RTX || GET_CODE (insn) != INSN)
+- return false;
+-
+- body = PATTERN (insn);
+-
+- if (GET_CODE (body) != SET)
+- return false;
+-
+- lhs = XEXP (body, 0);
+- rhs = XEXP (body, 1);
+-
+- lhs = REG_OR_SUBREG_RTX (lhs);
+-
+- /* If the destination is not a general purpose
+- register we do not have to worry. */
+- if (GET_CODE (lhs) != REG
+- || REGNO_REG_CLASS (REGNO (lhs)) != GENERAL_REGS)
+- return false;
+-
+- /* As well as loads from memory we also have to react
+- to loads of invalid constants which will be turned
+- into loads from the minipool. */
+- return (GET_CODE (rhs) == MEM
+- || GET_CODE (rhs) == SYMBOL_REF
+- || note_invalid_constants (insn, -1, false));
+-}
+-
+ /* Return TRUE if INSN is a Cirrus instruction. */
+ static bool
+ arm_cirrus_insn_p (rtx insn)
+@@ -5452,124 +5433,218 @@
+ return attr != CIRRUS_NOT;
+ }
+
+-/* Cirrus reorg for invalid instruction combinations. */
+-static void
+-cirrus_reorg (rtx first)
++/* Return TRUE if ISN does memory access. */
++static bool
++arm_mem_access_p (rtx insn)
+ {
+- enum attr_cirrus attr;
+- rtx body = PATTERN (first);
+- rtx t;
+- int nops;
++ enum attr_type attr;
+
+- /* Any branch must be followed by 2 non Cirrus instructions. */
+- if (GET_CODE (first) == JUMP_INSN && GET_CODE (body) != RETURN)
+- {
+- nops = 0;
+- t = next_nonnote_insn (first);
++ /* get_attr aborts on USE and CLOBBER. */
++ if (!insn
++ || GET_CODE (insn) != INSN
++ || GET_CODE (PATTERN (insn)) == USE
++ || GET_CODE (PATTERN (insn)) == CLOBBER)
++ return 0;
+
+- if (arm_cirrus_insn_p (t))
+- ++ nops;
++ attr = get_attr_type (insn);
+
+- if (arm_cirrus_insn_p (next_nonnote_insn (t)))
+- ++ nops;
++ return attr == TYPE_LOAD_BYTE
++ || attr == TYPE_LOAD1 || attr == TYPE_LOAD2 || attr == TYPE_LOAD3 || attr == TYPE_LOAD4
++ || attr == TYPE_F_CVT
++ || attr == TYPE_F_MEM_R || attr == TYPE_R_MEM_F || attr == TYPE_F_2_R || attr == TYPE_R_2_F
++ || attr == TYPE_F_LOAD || attr == TYPE_F_LOADS || attr == TYPE_F_LOADD
++ || attr == TYPE_F_STORE || attr == TYPE_F_STORES || attr == TYPE_F_STORED
++ || attr == TYPE_STORE1 || attr == TYPE_STORE2 || attr == TYPE_STORE3 || attr == TYPE_STORE4;
++
++}
+
+- while (nops --)
+- emit_insn_after (gen_nop (), first);
++/* Return TRUE if destination is certain Cirrus register. */
++static bool
++cirrus_dest_regn_p (rtx body, int regn)
++{
++ rtx lhs;
++ int reg;
++ lhs = XEXP (body, 0);
++ if (GET_CODE (lhs) != REG)
++ return 0;
+
+- return;
+- }
++ reg = REGNO (lhs);
++ if (REGNO_REG_CLASS (reg) != CIRRUS_REGS)
++ return 0;
+
+- /* (float (blah)) is in parallel with a clobber. */
+- if (GET_CODE (body) == PARALLEL && XVECLEN (body, 0) > 0)
+- body = XVECEXP (body, 0, 0);
++ return reg == regn;
++}
++
++/* Get previous/next machine instruction during Cirrus workaround scans.
++ Assume worst case (for the purpose of Cirrus workarounds)
++ for JUMP / CALL instructions. */
++static rtx
++cirrus_prev_next_mach_insn (rtx insn, int *len, int next)
++{
++ rtx t;
++ int l = 0;
+
+- if (GET_CODE (body) == SET)
++ /* It seems that we can count only on INSN length. */
++ for ( ; ; )
+ {
+- rtx lhs = XEXP (body, 0), rhs = XEXP (body, 1);
++ if (next)
++ insn = NEXT_INSN (insn);
++ else
++ insn = PREV_INSN (insn);
++ if (!insn)
++ break;
+
+- /* cfldrd, cfldr64, cfstrd, cfstr64 must
+- be followed by a non Cirrus insn. */
+- if (get_attr_cirrus (first) == CIRRUS_DOUBLE)
+- {
+- if (arm_cirrus_insn_p (next_nonnote_insn (first)))
+- emit_insn_after (gen_nop (), first);
++ if (GET_CODE (insn) == INSN)
++ {
++ l = get_attr_length (insn) / 4;
++ if (l)
++ break;
++ }
++ else if (GET_CODE (insn) == JUMP_INSN)
++ {
++ l = 1;
++ t = is_jump_table (insn);
++ if (t)
++ l += get_jump_table_size (t) / 4;
++ break;
++ }
++ else if (GET_CODE (insn) == CALL_INSN)
++ {
++ l = 1;
++ break;
++ }
++ }
+
+- return;
+- }
+- else if (arm_memory_load_p (first))
+- {
+- unsigned int arm_regno;
++ if (len)
++ *len = l;
+
+- /* Any ldr/cfmvdlr, ldr/cfmvdhr, ldr/cfmvsr, ldr/cfmv64lr,
+- ldr/cfmv64hr combination where the Rd field is the same
+- in both instructions must be split with a non Cirrus
+- insn. Example:
+-
+- ldr r0, blah
+- nop
+- cfmvsr mvf0, r0. */
+-
+- /* Get Arm register number for ldr insn. */
+- if (GET_CODE (lhs) == REG)
+- arm_regno = REGNO (lhs);
+- else
+- {
+- gcc_assert (GET_CODE (rhs) == REG);
+- arm_regno = REGNO (rhs);
+- }
++ return insn;
++}
+
+- /* Next insn. */
+- first = next_nonnote_insn (first);
++static rtx
++cirrus_prev_mach_insn (rtx insn, int *len)
++{
++ return cirrus_prev_next_mach_insn (insn, len, 0);
++}
+
+- if (! arm_cirrus_insn_p (first))
+- return;
++static rtx
++cirrus_next_mach_insn (rtx insn, int *len)
++{
++ return cirrus_prev_next_mach_insn (insn, len, 1);
++}
+
+- body = PATTERN (first);
++/* Cirrus reorg for branch slots. */
++static void
++cirrus_reorg_branch (rtx insn)
++{
++ rtx t;
++ int nops, l;
+
+- /* (float (blah)) is in parallel with a clobber. */
+- if (GET_CODE (body) == PARALLEL && XVECLEN (body, 0))
+- body = XVECEXP (body, 0, 0);
+-
+- if (GET_CODE (body) == FLOAT)
+- body = XEXP (body, 0);
+-
+- if (get_attr_cirrus (first) == CIRRUS_MOVE
+- && GET_CODE (XEXP (body, 1)) == REG
+- && arm_regno == REGNO (XEXP (body, 1)))
+- emit_insn_after (gen_nop (), first);
++ /* TODO: handle jump-tables. */
++ t = is_jump_table (insn);
++ if (t)
++ return;
++
++ /* Any branch must be followed by 2 non Cirrus instructions. */
++ t = insn;
++ for (nops = 2; nops > 0; )
++ {
++ if (!cirrus_next_mach_insn (t, 0))
++ {
++ insn = t;
++ break;
++ }
++ t = cirrus_next_mach_insn (t, &l);
++ if (arm_cirrus_insn_p (t))
++ break;
++ nops -= l;
+
+- return;
+- }
+ }
+
+- /* get_attr cannot accept USE or CLOBBER. */
+- if (!first
+- || GET_CODE (first) != INSN
+- || GET_CODE (PATTERN (first)) == USE
+- || GET_CODE (PATTERN (first)) == CLOBBER)
+- return;
++ while (nops-- > 0)
++ emit_insn_after (gen_nop (), insn); /* WARNING: this appears to cause "bad immediate value for offset" errors in the assembler */
++}
+
+- attr = get_attr_cirrus (first);
++/* Cirrus reorg for bug #1 (cirrus + cfcmpxx). */
++static void
++cirrus_reorg_bug1 (rtx insn)
++{
++ rtx body = PATTERN (insn), body2;
++ rtx t;
++ int i, nops, l;
++ enum attr_cirrus attr;
+
+- /* Any coprocessor compare instruction (cfcmps, cfcmpd, ...)
+- must be followed by a non-coprocessor instruction. */
+- if (attr == CIRRUS_COMPARE)
++ /* Check if destination or clobber is Cirrus register. */
++ if (GET_CODE (body) == PARALLEL)
+ {
+- nops = 0;
+-
+- t = next_nonnote_insn (first);
++ for (i = 0; i < XVECLEN (body, 0); i++)
++ {
++ body2 = XVECEXP (body, 0, i);
++ if (GET_CODE (body2) == SET)
++ {
++ if (cirrus_dest_regn_p (body2, LAST_CIRRUS_FP_REGNUM))
++ {
++ nops = 5;
++ goto fix;
++ }
++ }
++ else if (GET_CODE (body2) == CLOBBER)
++ {
++ if (cirrus_dest_regn_p (body2, LAST_CIRRUS_FP_REGNUM))
++ {
++ nops = 4;
++ goto fix;
++ }
++ }
++ }
++ }
++ else if (GET_CODE (body) == SET)
++ {
++ if (cirrus_dest_regn_p (body, LAST_CIRRUS_FP_REGNUM))
++ {
++ nops = 5;
++ goto fix;
++ }
++ }
++ return;
+
+- if (arm_cirrus_insn_p (t))
+- ++ nops;
++fix:
++ t = insn;
++ for ( ; nops > 0; )
++ {
++ t = cirrus_next_mach_insn (t, &l);
++ if (!t)
++ break;
++ if (GET_CODE (t) == JUMP_INSN
++ || GET_CODE (t) == CALL_INSN)
++ {
++ nops -= l;
++ break;
++ }
++ else if (arm_cirrus_insn_p (t))
++ {
++ attr = get_attr_cirrus (t);
++ if (attr == CIRRUS_COMPARE)
++ break;
++ }
++ nops -= l;
++ }
+
+- if (arm_cirrus_insn_p (next_nonnote_insn (t)))
+- ++ nops;
++ while (nops-- > 0)
++ emit_insn_after (gen_nop (), insn); /* WARNING: this appears to cause "bad immediate value for offset" errors in the assembler */
++}
+
+- while (nops --)
+- emit_insn_after (gen_nop (), first);
++/* Cirrus reorg for bugs #10 and #12 (data aborts). */
++static void
++cirrus_reorg_bug10_12 (rtx insn)
++{
++ rtx t;
+
+- return;
+- }
++ t = cirrus_next_mach_insn (insn, 0);
++ if (arm_cirrus_insn_p (t))
++ if (TARGET_CIRRUS_D0 ||
++ get_attr_cirrus (t) == CIRRUS_DOUBLE)
++ emit_insn_after (gen_nop (), insn); /* WARNING: this appears to cause "bad immediate value for offset" errors in the assembler */
+ }
+
+ /* Return TRUE if X references a SYMBOL_REF. */
+@@ -7727,7 +7796,7 @@
+ {
+ Mnode * mp;
+ Mnode * nmp;
+- int align64 = 0;
++ int align64 = 0, stuffnop = 0;
+
+ if (ARM_DOUBLEWORD_ALIGN)
+ for (mp = minipool_vector_head; mp != NULL; mp = mp->next)
+@@ -7742,8 +7811,27 @@
+ ";; Emitting minipool after insn %u; address %ld; align %d (bytes)\n",
+ INSN_UID (scan), (unsigned long) minipool_barrier->address, align64 ? 8 : 4);
+
++ /* Check if branch before minipool is already stuffed with nops. */
++ if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1)
++ {
++ rtx t;
++
++ t = prev_active_insn (scan);
++ if (GET_CODE (t) != INSN
++ || PATTERN (t) != const0_rtx)
++ stuffnop = 1;
++ }
+ scan = emit_label_after (gen_label_rtx (), scan);
+ scan = emit_insn_after (align64 ? gen_align_8 () : gen_align_4 (), scan);
++ /* Last instruction was branch, so put two non-Cirrus opcodes. */
++ if (stuffnop)
++ {
++#if TARGET_CIRRUS /* This is doubling up on nops, so I don't think this is a good idea */
++ emit_insn_before (gen_nop (), scan); /* WARNING: this appears to cause "bad immediate value for offset" errors in the assembler */
++ emit_insn_before (gen_nop (), scan); /* WARNING: this appears to cause "bad immediate value for offset" errors in the assembler */
++#endif
++ }
++
+ scan = emit_label_after (minipool_vector_label, scan);
+
+ for (mp = minipool_vector_head; mp != NULL; mp = nmp)
+@@ -8151,15 +8239,38 @@
+ gcc_assert (GET_CODE (insn) == NOTE);
+ minipool_pad = 0;
+
++#if TARGET_CIRRUS /* I think this is a double-up */
++ /* Scan all the insn and fix Cirrus issues. */
++ if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1)
++ {
++ rtx t, s;
++
++ for (t = cirrus_next_mach_insn (insn, 0); t; t = cirrus_next_mach_insn (t, 0))
++ if (arm_mem_access_p (t))
++ cirrus_reorg_bug10_12 (t);
++
++ if (TARGET_CIRRUS_D0)
++ for (t = cirrus_next_mach_insn (insn, 0); t; t = cirrus_next_mach_insn (t, 0))
++ if (arm_cirrus_insn_p (t))
++ cirrus_reorg_bug1 (t);
++
++ /* Find last insn. */
++ for (t = insn; ; t = s)
++ {
++ s = cirrus_next_mach_insn (t, 0);
++ if (!s)
++ break;
++ }
++ /* Scan backward and fix branches. - WARNING: appears to cause "bad immediate value for offset" problems! */
++ for ( ; t; t = cirrus_prev_mach_insn (t, 0))
++ if (GET_CODE (t) == JUMP_INSN
++ || GET_CODE (t) == CALL_INSN)
++ cirrus_reorg_branch (t);
++ }
++#endif
+ /* Scan all the insns and record the operands that will need fixing. */
+ for (insn = next_nonnote_insn (insn); insn; insn = next_nonnote_insn (insn))
+ {
+- if (TARGET_CIRRUS_FIX_INVALID_INSNS
+- && (arm_cirrus_insn_p (insn)
+- || GET_CODE (insn) == JUMP_INSN
+- || arm_memory_load_p (insn)))
+- cirrus_reorg (insn);
+-
+ if (GET_CODE (insn) == BARRIER)
+ push_minipool_barrier (insn, address);
+ else if (INSN_P (insn))
+@@ -11755,16 +11910,10 @@
+ || get_attr_conds (this_insn) != CONDS_NOCOND)
+ fail = TRUE;
+
+- /* A conditional cirrus instruction must be followed by
+- a non Cirrus instruction. However, since we
+- conditionalize instructions in this function and by
+- the time we get here we can't add instructions
+- (nops), because shorten_branches() has already been
+- called, we will disable conditionalizing Cirrus
+- instructions to be safe. */
+- if (GET_CODE (scanbody) != USE
+- && GET_CODE (scanbody) != CLOBBER
+- && get_attr_cirrus (this_insn) != CIRRUS_NOT)
++ /* To avoid erratic behaviour, we avoid conditional Cirrus
++ instructions when doing workarounds. */
++ if (arm_cirrus_insn_p(this_insn)
++ && (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1))
+ fail = TRUE;
+ break;
+
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.h gcc-4.1.2/gcc/config/arm/arm.h
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.h 2005-11-05 01:02:51.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.h 2007-05-15 10:15:05.000000000 +1000
+@@ -5,6 +5,7 @@
+ and Martin Simmons (@harleqn.co.uk).
+ More major hacks by Richard Earnshaw (rearnsha@arm.com)
+ Minor hacks by Nick Clifton (nickc@cygnus.com)
++ Cirrus Crunch fixes by Vladimir Ivanov (vladitx@nucleusys.com)
+
+ This file is part of GCC.
+
+@@ -140,7 +141,9 @@
+ %{msoft-float:%{mhard-float: \
+ %e-msoft-float and -mhard_float may not be used together}} \
+ %{mbig-endian:%{mlittle-endian: \
+- %e-mbig-endian and -mlittle-endian may not be used together}}"
++ %e-mbig-endian and -mlittle-endian may not be used together}} \
++%{mfix-crunch-d0:%{mfix-crunch-d1: \
++ %e-mfix-crunch-d0 and -mfix-crunch-d1 may not be used together}}"
+
+ #ifndef CC1_SPEC
+ #define CC1_SPEC ""
+@@ -179,6 +182,9 @@
+ #define TARGET_HARD_FLOAT_ABI (arm_float_abi == ARM_FLOAT_ABI_HARD)
+ #define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA)
+ #define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK)
++#define TARGET_CIRRUS (arm_arch_cirrus)
++#define TARGET_CIRRUS_D0 0 /* (target_flags & ARM_FLAG_CIRRUS_D0) */
++#define TARGET_CIRRUS_D1 1 /* (target_flags & ARM_FLAG_CIRRUS_D1) */
+ #define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP)
+ #define TARGET_IWMMXT (arm_arch_iwmmxt)
+ #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM)
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.opt gcc-4.1.2/gcc/config/arm/arm.opt
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.opt 2005-11-05 01:02:51.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.opt 2007-05-15 10:09:31.000000000 +1000
+@@ -68,6 +68,14 @@
+ Target Report Mask(CIRRUS_FIX_INVALID_INSNS)
+ Cirrus: Place NOPs to avoid invalid instruction combinations
+
++fix-crunch-d0
++Target Report Mask(ARM_FLAG_CIRRUS_D0)
++Cirrus: workarounds for Crunch coprocessor revision D0
++
++fix-crunch-d1
++Target Report Mask(ARM_FLAG_CIRRUS_D1)
++Cirrus: workarounds for Crunch coprocessor revision D1
++
+ mcpu=
+ Target RejectNegative Joined
+ Specify the name of the target CPU
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/doc/invoke.texi gcc-4.1.2/gcc/doc/invoke.texi
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/doc/invoke.texi 2006-09-26 07:21:58.000000000 +1000
++++ gcc-4.1.2/gcc/doc/invoke.texi 2007-05-15 10:07:04.000000000 +1000
+@@ -408,7 +408,7 @@
+ -msingle-pic-base -mno-single-pic-base @gol
+ -mpic-register=@var{reg} @gol
+ -mnop-fun-dllimport @gol
+--mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
++-mfix-crunch-d0 -mfix-crunch-d1 @gol
+ -mpoke-function-name @gol
+ -mthumb -marm @gol
+ -mtpcs-frame -mtpcs-leaf-frame @gol
+@@ -7435,17 +7435,12 @@
+ Specify the register to be used for PIC addressing. The default is R10
+ unless stack-checking is enabled, when R9 is used.
+
+-@item -mcirrus-fix-invalid-insns
+-@opindex mcirrus-fix-invalid-insns
+-@opindex mno-cirrus-fix-invalid-insns
+-Insert NOPs into the instruction stream to in order to work around
+-problems with invalid Maverick instruction combinations. This option
+-is only valid if the @option{-mcpu=ep9312} option has been used to
+-enable generation of instructions for the Cirrus Maverick floating
+-point co-processor. This option is not enabled by default, since the
+-problem is only present in older Maverick implementations. The default
+-can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
+-switch.
++@item -mfix-crunch-d0
++@itemx -mfix-crunch-d1
++@opindex mfix-crunch-d0
++@opindex mfix-crunch-d1
++Enable workarounds for the Cirrus MaverickCrunch coprocessor revisions
++D0 and D1 respectively.
+
+ @item -mpoke-function-name
+ @opindex mpoke-function-name
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-compare-geu.patch b/packages/gcc/gcc-4.2.2/arm-crunch-compare-geu.patch
new file mode 100644
index 0000000000..3d27cc1d9d
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-compare-geu.patch
@@ -0,0 +1,48 @@
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-08 06:39:41.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-08 06:41:00.000000000 +1000
+@@ -7125,6 +7125,22 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match GEU for MAVERICK.
++(define_insn "*arm_bgeu"
++ [(set (pc)
++ (if_then_else (geu (match_operand 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++ if (get_attr_cirrus (prev_active_insn(insn)) == CIRRUS_COMPARE)
++ return \"beq\\t%l0\;bvs\\t%l0\"; else return \"bge\\t%l0\;nop\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
+ ; Special pattern to match UNLT for MAVERICK - UGLY since we need to test for Z=0 && V=0.
+ (define_insn "*arm_bunlt"
+ [(set (pc)
+@@ -7240,6 +7256,22 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match reversed GEU for MAVERICK.
++(define_insn "*arm_bgeu_reversed"
++ [(set (pc)
++ (if_then_else (geu (match_operand 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t.+12\;bvs\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
++
+ ; Special pattern to match reversed UNLT for MAVERICK.
+ (define_insn "*arm_bunlt_reversed"
+ [(set (pc)
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch b/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch
new file mode 100644
index 0000000000..c4fcdb3746
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch
@@ -0,0 +1,98 @@
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-07 14:45:22.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-07 15:13:58.000000000 +1000
+@@ -7001,16 +7001,16 @@
+ (if_then_else (unordered (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
+ (define_expand "bordered"
+ [(set (pc)
+ (if_then_else (ordered (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
+ arm_compare_op1);"
+@@ -7141,6 +7141,38 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match UNORDERED for MAVERICK - UGLY since we need to test for Z=0 && N=0.
++(define_insn "*arm_bunordered"
++ [(set (pc)
++ (if_then_else (unordered (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t.+12\;bmi\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
++
++; Special pattern to match ORDERED for MAVERICK.
++(define_insn "*arm_bordered"
++ [(set (pc)
++ (if_then_else (ordered (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bmi\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
+ (define_insn "*arm_cond_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7224,6 +7256,37 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match reversed UNORDERED for MAVERICK.
++(define_insn "*arm_bunordered_reversed"
++ [(set (pc)
++ (if_then_else (unordered (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bmi\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++; Special pattern to match reversed ORDERED for MAVERICK - UGLY since we need to test for Z=0 && N=0.
++(define_insn "*arm_bordered_reversed"
++ [(set (pc)
++ (if_then_else (ordered (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t.+12\;bmi\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
+
+ (define_insn "*arm_cond_branch_reversed"
+ [(set (pc)
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch-z-eq b/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch-z-eq
new file mode 100644
index 0000000000..715fb95086
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-compare-unordered.patch-z-eq
@@ -0,0 +1,98 @@
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-07 14:45:22.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-07 15:13:58.000000000 +1000
+@@ -7001,16 +7001,16 @@
+ (if_then_else (unordered (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
+ (define_expand "bordered"
+ [(set (pc)
+ (if_then_else (ordered (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
+ arm_compare_op1);"
+@@ -7141,6 +7141,38 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match UNORDERED for MAVERICK - UGLY since we need to test for C=0 && N=0
++(define_insn "*arm_bunordered"
++ [(set (pc)
++ (if_then_else (unordered (match_operand 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bcs\\t.+12\;bmi\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
++
++; Special pattern to match ORDERED for MAVERICK.
++(define_insn "*arm_bordered"
++ [(set (pc)
++ (if_then_else (ordered (match_operand 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bcs\\t%l0\;bmi\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
+ (define_insn "*arm_cond_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7224,6 +7256,37 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match reversed UNORDERED for MAVERICK.
++(define_insn "*arm_bunordered_reversed"
++ [(set (pc)
++ (if_then_else (unordered (match_operand 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bcs\\t%l0\;bmi\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++; Special pattern to match reversed ORDERED for MAVERICK - UGLY since we need to test for C=0 && N=0
++(define_insn "*arm_bordered_reversed"
++ [(set (pc)
++ (if_then_else (ordered (match_operand 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bcs\\t.+12\;bmi\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
+
+ (define_insn "*arm_cond_branch_reversed"
+ [(set (pc)
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch b/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch
new file mode 100644
index 0000000000..ccbb4854c3
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch
@@ -0,0 +1,400 @@
+diff -urN gcc-4.1.2/gcc/config/arm/arm.c ../../../../old-tmp/work/arm-oabi-angstrom-linux/gcc-cross-4.1.2-backup/gcc-4.1.2/gcc/config/arm/arm.c
+--- gcc-4.1.2/gcc/config/arm/arm.c 2007-05-31 12:39:48.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-05-29 17:19:38.000000000 +1000
+@@ -11427,26 +11427,53 @@
+ /* These encodings assume that AC=1 in the FPA system control
+ byte. This allows us to handle all cases except UNEQ and
+ LTGT. */
+- switch (comp_code)
+- {
+- case GE: return ARM_GE;
+- case GT: return ARM_GT;
+- case LE: return ARM_LS;
+- case LT: return ARM_MI;
+- case NE: return ARM_NE;
+- case EQ: return ARM_EQ;
+- case ORDERED: return ARM_VC;
+- case UNORDERED: return ARM_VS;
+- case UNLT: return ARM_LT;
+- case UNLE: return ARM_LE;
+- case UNGT: return ARM_HI;
+- case UNGE: return ARM_PL;
+- /* UNEQ and LTGT do not have a representation. */
+- case UNEQ: /* Fall through. */
+- case LTGT: /* Fall through. */
+- default: gcc_unreachable ();
+- }
+-
++ if (!TARGET_MAVERICK)
++ {
++ switch (comp_code)
++ {
++ case GE: return ARM_GE;
++ case GT: return ARM_GT;
++ case LE: return ARM_LS;
++ case LT: return ARM_MI;
++ case NE: return ARM_NE;
++ case EQ: return ARM_EQ;
++ case ORDERED: return ARM_VC;
++ case UNORDERED: return ARM_VS;
++ case UNLT: return ARM_LT;
++ case UNLE: return ARM_LE;
++ case UNGT: return ARM_HI;
++ case UNGE: return ARM_PL;
++ /* UNEQ and LTGT do not have a representation. */
++ case UNEQ: /* Fall through. */
++ case LTGT: /* Fall through. */
++ default: gcc_unreachable ();
++ }
++ }
++ else
++ {
++ /* CIRRUS */
++ switch (comp_code)
++ {
++#if 1
++ case GT: return ARM_VS;
++ case LE: return ARM_LE;
++ case LT: return ARM_LT;
++ case NE: return ARM_NE;
++ case EQ: return ARM_EQ;
++ case UNLE: return ARM_VC;
++ case UNGT: return ARM_GT;
++ case UNGE: return ARM_GE;
++ case UNEQ: return ARM_PL;
++ case LTGT: return ARM_MI;
++ /* These do not have a representation. */
++ case GE: /* Fall through. -UNGE wrong atm */
++ case UNLT: /* Fall through. -LT wrong atm */
++ case ORDERED: /* Fall through. -AL wrong atm */
++ case UNORDERED: /* Fall through. -AL wrong atm */
++#endif
++ default: gcc_unreachable ();
++ }
++ }
+ case CC_SWPmode:
+ switch (comp_code)
+ {
+diff -urN gcc-4.1.2/gcc/config/arm/arm.md ../../../../old-tmp/work/arm-oabi-angstrom-linux/gcc-cross-4.1.2-backup/gcc-4.1.2/gcc/config/arm/arm.md
+--- gcc-4.1.2/gcc/config/arm/arm.md 2007-05-31 12:39:48.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-05-29 15:17:18.000000000 +1000
+@@ -6952,10 +6952,11 @@
+ "operands[1] = arm_gen_compare_reg (LE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;broken on cirrus
+ (define_expand "bge"
+ [(set (pc)
+ (if_then_else (ge (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM"
++ "TARGET_ARM" ;; && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+@@ -6988,6 +6989,7 @@
+ "operands[1] = arm_gen_compare_reg (LEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++; broken on cirrus?
+ (define_expand "bgeu"
+ [(set (pc)
+ (if_then_else (geu (match_dup 1) (const_int 0))
+@@ -7031,14 +7033,15 @@
+ (if_then_else (ungt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);"
+ )
+
+-(define_expand "bunlt"
++; broken for cirrus
++(define_expand "bunlt"
+ [(set (pc)
+ (if_then_else (unlt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);"
+@@ -7049,7 +7052,7 @@
+ (if_then_else (unge (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7058,7 +7061,7 @@
+ (if_then_else (unle (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7069,7 +7072,7 @@
+ (if_then_else (uneq (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" ;; || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7078,7 +7081,7 @@
+ (if_then_else (ltgt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" ;; || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7086,7 +7089,7 @@
+ ;; Patterns to match conditional branch insns.
+ ;;
+
+-; Special pattern to match UNEQ.
++; Special pattern to match UNEQ for FPA and VFP.
+ (define_insn "*arm_buneq"
+ [(set (pc)
+ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7102,7 +7105,7 @@
+ (set_attr "length" "8")]
+ )
+
+-; Special pattern to match LTGT.
++; Special pattern to match LTGT for FPA and VFP.
+ (define_insn "*arm_bltgt"
+ [(set (pc)
+ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7118,6 +7121,38 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match GE for MAVERICK.
++(define_insn "*arm_bge"
++ [(set (pc)
++ (if_then_else (ge (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bvs\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++; Special pattern to match UNLT for MAVERICK - UGLY since we need to test for Z=0 && V=0.
++(define_insn "*arm_bunlt"
++ [(set (pc)
++ (if_then_else (unlt (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t.+12\;bvs\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
++
+ (define_insn "*arm_cond_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7137,7 +7172,7 @@
+ (set_attr "type" "branch")]
+ )
+
+-; Special pattern to match reversed UNEQ.
++; Special pattern to match reversed UNEQ for FPA and VFP.
+ (define_insn "*arm_buneq_reversed"
+ [(set (pc)
+ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7153,7 +7188,7 @@
+ (set_attr "length" "8")]
+ )
+
+-; Special pattern to match reversed LTGT.
++; Special pattern to match reversed LTGT for FPA and VFP.
+ (define_insn "*arm_bltgt_reversed"
+ [(set (pc)
+ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7169,6 +7204,39 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match reversed GE for MAVERICK - UGLY since we need to tst for Z=0 && N=0.
++(define_insn "*arm_bge_reversed"
++ [(set (pc)
++ (if_then_else (ge (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t.+12\;bvs\\t.+8\;b\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "12")]
++)
++
++; Special pattern to match reversed UNLT for MAVERICK.
++(define_insn "*arm_bunlt_reversed"
++ [(set (pc)
++ (if_then_else (unlt (match_operand:CCFP 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bvs\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++
+ (define_insn "*arm_cond_branch_reversed"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7220,8 +7288,9 @@
+ "operands[1] = arm_gen_compare_reg (LE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;; broken for cirrus - definitely
+ (define_expand "sge"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ge:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM"
++ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+@@ -7227,6 +7296,14 @@
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SGE these can not be represented with MAVERICK
++; (define_expand "sge"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (ge:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "slt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (lt:SI (match_dup 1) (const_int 0)))]
+@@ -7248,6 +7325,7 @@
+ "operands[1] = arm_gen_compare_reg (LEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++;; broken for cirrus - maybe
+ (define_expand "sgeu"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (geu:SI (match_dup 1) (const_int 0)))]
+@@ -7255,6 +7333,14 @@
+ "operands[1] = arm_gen_compare_reg (GEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SGEU these may not be represented with MAVERICK?
++; (define_expand "sgeu"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (ge:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "sltu"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ltu:SI (match_dup 1) (const_int 0)))]
+@@ -7281,7 +7367,7 @@
+ (define_expand "sungt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ungt:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7289,23 +7375,32 @@
+ (define_expand "sunge"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unge:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
++; broken for cirrus
+ (define_expand "sunlt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unlt:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SUNLT these can't be represented with MAVERICK
++; (define_expand "sunlt"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (unlt:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "sunle"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unle:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7371,7 +7466,7 @@
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if ((code == UNEQ || code == LTGT) || (TARGET_MAVERICK && (code == GE || code == UNLT || code == ORDERED || code == UNORDERED)))
+ FAIL;
+
+ ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1);
+@@ -7390,7 +7485,8 @@
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if ((code == UNEQ || code == LTGT) || (TARGET_MAVERICK && (code == GE || code == UNLT || code == ORDERED || code == UNORDERED)))
++
+ FAIL;
+
+ /* When compiling for SOFT_FLOAT, ensure both arms are in registers.
+@@ -7409,13 +7505,13 @@
+ (if_then_else:DF (match_operand 1 "arm_comparison_operator" "")
+ (match_operand:DF 2 "s_register_operand" "")
+ (match_operand:DF 3 "arm_float_add_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "
+ {
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if ((code == UNEQ || code == LTGT) || (TARGET_MAVERICK && (code==GE || code == UNLT || code == ORDERED || code == UNORDERED)))
+ FAIL;
+
+ ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1);
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch-z-eq b/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch-z-eq
new file mode 100644
index 0000000000..bc40411be4
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-compare.patch-z-eq
@@ -0,0 +1,400 @@
+diff -urN gcc-4.1.2/gcc/config/arm/arm.c ../../../../old-tmp/work/arm-oabi-angstrom-linux/gcc-cross-4.1.2-backup/gcc-4.1.2/gcc/config/arm/arm.c
+--- gcc-4.1.2/gcc/config/arm/arm.c 2007-05-31 12:39:48.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-05-29 17:19:38.000000000 +1000
+@@ -11427,26 +11427,53 @@
+ /* These encodings assume that AC=1 in the FPA system control
+ byte. This allows us to handle all cases except UNEQ and
+ LTGT. */
+- switch (comp_code)
+- {
+- case GE: return ARM_GE;
+- case GT: return ARM_GT;
+- case LE: return ARM_LS;
+- case LT: return ARM_MI;
+- case NE: return ARM_NE;
+- case EQ: return ARM_EQ;
+- case ORDERED: return ARM_VC;
+- case UNORDERED: return ARM_VS;
+- case UNLT: return ARM_LT;
+- case UNLE: return ARM_LE;
+- case UNGT: return ARM_HI;
+- case UNGE: return ARM_PL;
+- /* UNEQ and LTGT do not have a representation. */
+- case UNEQ: /* Fall through. */
+- case LTGT: /* Fall through. */
+- default: gcc_unreachable ();
+- }
+-
++ if (!TARGET_MAVERICK)
++ {
++ switch (comp_code)
++ {
++ case GE: return ARM_GE;
++ case GT: return ARM_GT;
++ case LE: return ARM_LS;
++ case LT: return ARM_MI;
++ case NE: return ARM_NE;
++ case EQ: return ARM_EQ;
++ case ORDERED: return ARM_VC;
++ case UNORDERED: return ARM_VS;
++ case UNLT: return ARM_LT;
++ case UNLE: return ARM_LE;
++ case UNGT: return ARM_HI;
++ case UNGE: return ARM_PL;
++ /* UNEQ and LTGT do not have a representation. */
++ case UNEQ: /* Fall through. */
++ case LTGT: /* Fall through. */
++ default: gcc_unreachable ();
++ }
++ }
++ else
++ {
++ /* CIRRUS */
++ switch (comp_code)
++ {
++#if 1
++ case GT: return ARM_VS;
++ case LE: return ARM_LE;
++ case LT: return ARM_LT;
++ case NE: return ARM_NE;
++ case EQ: return ARM_EQ;
++ case UNLE: return ARM_VC;
++ case UNGT: return ARM_GT;
++ case UNGE: return ARM_GE;
++ case UNEQ: return ARM_PL;
++ case LTGT: return ARM_MI;
++ /* These do not have a representation. */
++ case GE: /* Fall through. -UNGE wrong atm */
++ case UNLT: /* Fall through. -LT wrong atm */
++ case ORDERED: /* Fall through. -AL wrong atm */
++ case UNORDERED: /* Fall through. -AL wrong atm */
++#endif
++ default: gcc_unreachable ();
++ }
++ }
+ case CC_SWPmode:
+ switch (comp_code)
+ {
+diff -urN gcc-4.1.2/gcc/config/arm/arm.md ../../../../old-tmp/work/arm-oabi-angstrom-linux/gcc-cross-4.1.2-backup/gcc-4.1.2/gcc/config/arm/arm.md
+--- gcc-4.1.2/gcc/config/arm/arm.md 2007-05-31 12:39:48.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-05-29 15:17:18.000000000 +1000
+@@ -6952,10 +6952,11 @@
+ "operands[1] = arm_gen_compare_reg (LE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;broken on cirrus
+ (define_expand "bge"
+ [(set (pc)
+ (if_then_else (ge (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM"
++ "TARGET_ARM"
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+@@ -6988,6 +6989,7 @@
+ "operands[1] = arm_gen_compare_reg (LEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++; broken on cirrus?
+ (define_expand "bgeu"
+ [(set (pc)
+ (if_then_else (geu (match_dup 1) (const_int 0))
+@@ -7031,14 +7033,15 @@
+ (if_then_else (ungt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);"
+ )
+
+-(define_expand "bunlt"
++; broken for cirrus
++(define_expand "bunlt"
+ [(set (pc)
+ (if_then_else (unlt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);"
+@@ -7049,7 +7052,7 @@
+ (if_then_else (unge (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7058,7 +7061,7 @@
+ (if_then_else (unle (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7069,7 +7072,7 @@
+ (if_then_else (uneq (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" ;; || TARGET_MAVERICK
+ "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7078,7 +7081,7 @@
+ (if_then_else (ltgt (match_dup 1) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" ;; || TARGET_MAVERICK
+ "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7086,7 +7089,7 @@
+ ;; Patterns to match conditional branch insns.
+ ;;
+
+-; Special pattern to match UNEQ.
++; Special pattern to match UNEQ for FPA and VFP.
+ (define_insn "*arm_buneq"
+ [(set (pc)
+ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7102,7 +7105,7 @@
+ (set_attr "length" "8")]
+ )
+
+-; Special pattern to match LTGT.
++; Special pattern to match LTGT for FPA and VFP.
+ (define_insn "*arm_bltgt"
+ [(set (pc)
+ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7118,6 +7121,38 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match GE for MAVERICK.
++(define_insn "*arm_bge"
++ [(set (pc)
++ (if_then_else (ge (match_operand 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bvs\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++; Special pattern to match UNLT for MAVERICK.
++(define_insn "*arm_bunlt"
++ [(set (pc)
++ (if_then_else (unlt (match_operand 1 "cc_register" "") (const_int 0))
++ (label_ref (match_operand 0 "" ""))
++ (pc)))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bne\\t%l0\;bvc\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
+ (define_insn "*arm_cond_branch"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7137,7 +7172,7 @@
+ (set_attr "type" "branch")]
+ )
+
+-; Special pattern to match reversed UNEQ.
++; Special pattern to match reversed UNEQ for FPA and VFP.
+ (define_insn "*arm_buneq_reversed"
+ [(set (pc)
+ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7153,7 +7188,7 @@
+ (set_attr "length" "8")]
+ )
+
+-; Special pattern to match reversed LTGT.
++; Special pattern to match reversed LTGT for FPA and VFP.
+ (define_insn "*arm_bltgt_reversed"
+ [(set (pc)
+ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
+@@ -7169,6 +7204,39 @@
+ (set_attr "length" "8")]
+ )
+
++; Special pattern to match reversed GE for MAVERICK.
++(define_insn "*arm_bge_reversed"
++ [(set (pc)
++ (if_then_else (ge (match_operand 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"bne\\t%l0\;bvc\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++; Special pattern to match reversed UNLT for MAVERICK.
++(define_insn "*arm_bunlt_reversed"
++ [(set (pc)
++ (if_then_else (unlt (match_operand 1 "cc_register" "") (const_int 0))
++ (pc)
++ (label_ref (match_operand 0 "" ""))))]
++ "TARGET_ARM && (TARGET_MAVERICK)"
++ "*
++ gcc_assert (!arm_ccfsm_state);
++
++ return \"beq\\t%l0\;bvs\\t%l0\";
++ "
++ [(set_attr "conds" "jump_clob")
++ (set_attr "length" "8")]
++)
++
++
+ (define_insn "*arm_cond_branch_reversed"
+ [(set (pc)
+ (if_then_else (match_operator 1 "arm_comparison_operator"
+@@ -7220,8 +7288,9 @@
+ "operands[1] = arm_gen_compare_reg (LE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;; broken for cirrus - definitely
+ (define_expand "sge"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ge:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM"
++ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+@@ -7227,6 +7296,14 @@
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SGE these can not be represented with MAVERICK
++; (define_expand "sge"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (ge:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "slt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (lt:SI (match_dup 1) (const_int 0)))]
+@@ -7248,6 +7325,7 @@
+ "operands[1] = arm_gen_compare_reg (LEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++;; broken for cirrus - maybe
+ (define_expand "sgeu"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (geu:SI (match_dup 1) (const_int 0)))]
+@@ -7255,6 +7333,14 @@
+ "operands[1] = arm_gen_compare_reg (GEU, arm_compare_op0, arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SGEU these may not be represented with MAVERICK?
++; (define_expand "sgeu"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (ge:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "sltu"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ltu:SI (match_dup 1) (const_int 0)))]
+@@ -7281,7 +7367,7 @@
+ (define_expand "sungt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ungt:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7289,23 +7375,32 @@
+ (define_expand "sunge"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unge:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
++; broken for cirrus
+ (define_expand "sunlt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unlt:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0,
+ arm_compare_op1);"
+ )
+
++;;; DO NOT add patterns for SUNLT these can't be represented with MAVERICK
++; (define_expand "sunlt"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (unlt:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && (TARGET_MAVERICK)"
++; "gcc_unreachable ();"
++; )
++
+ (define_expand "sunle"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unle:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7371,7 +7466,7 @@
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if (code == UNEQ || code == LTGT || code == GE || code == UNLT || code == ORDERED || code == UNORDERED)
+ FAIL;
+
+ ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1);
+@@ -7390,7 +7485,8 @@
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if (code == UNEQ || code == LTGT || code == GE || code == UNLT || code == ORDERED || code == UNORDERED)
++
+ FAIL;
+
+ /* When compiling for SOFT_FLOAT, ensure both arms are in registers.
+@@ -7409,13 +7505,13 @@
+ (if_then_else:DF (match_operand 1 "arm_comparison_operator" "")
+ (match_operand:DF 2 "s_register_operand" "")
+ (match_operand:DF 3 "arm_float_add_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "
+ {
+ enum rtx_code code = GET_CODE (operands[1]);
+ rtx ccreg;
+
+- if (code == UNEQ || code == LTGT)
++ if (code == UNEQ || code == LTGT || code == GE || code == UNLT || code == ORDERED || code == UNORDERED)
+ FAIL;
+
+ ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1);
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-dominance.patch b/packages/gcc/gcc-4.2.2/arm-crunch-dominance.patch
new file mode 100644
index 0000000000..517ca8d80e
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-dominance.patch
@@ -0,0 +1,12 @@
+--- gcc-4.1.2/gcc/config/arm/arm.c-original 2007-06-13 11:50:10.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-06-13 11:50:56.000000000 +1000
+@@ -6556,6 +6556,9 @@
+ enum rtx_code cond1, cond2;
+ int swapped = 0;
+
++ if (TARGET_MAVERICK) // Simple hack for MAVERICK
++ return CCmode;
++
+ /* Currently we will probably get the wrong result if the individual
+ comparisons are not simple. This also ensures that it is safe to
+ reverse a comparison if necessary. */
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754-div.patch b/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754-div.patch
new file mode 100644
index 0000000000..940f4a65ae
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754-div.patch
@@ -0,0 +1,139 @@
+--- gcc-4.1.2/gcc/config/arm/ieee754-df-original.S 2007-06-25 10:22:06.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/ieee754-df.S 2007-06-25 10:27:17.000000000 +1000
+@@ -717,6 +717,10 @@
+ cmn r4, #(53 + 1)
+ movle xl, #0
+ bicle xh, xh, #0x7fffffff
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6" le
+
+ @ Find out proper shift value.
+@@ -738,6 +742,10 @@
+ adc xh, r2, xh, lsr r4
+ orrs lr, lr, r3, lsl #1
+ biceq xl, xl, r3, lsr #31
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ @ shift result right of 21 to 31 bits, or left 11 to 1 bits after
+@@ -752,6 +760,10 @@
+ adc xh, xh, #0
+ orrs lr, lr, r3, lsl #1
+ biceq xl, xl, r3, lsr #31
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ @ Shift value right of 32 to 64 bits, or 0 to 32 bits after a switch
+@@ -766,6 +778,10 @@
+ add xl, xl, r3, lsr #31
+ orrs lr, lr, r3, lsl #1
+ biceq xl, xl, r3, lsr #31
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ @ One or both arguments are denormalized.
+@@ -808,6 +824,10 @@
+ eor xh, xh, yh
+ bic xh, xh, #0x7fffffff
+ mov xl, #0
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ 1: @ One or both args are INF or NAN.
+@@ -837,12 +857,20 @@
+ orr xh, xh, #0x7f000000
+ orr xh, xh, #0x00f00000
+ mov xl, #0
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ @ Return a quiet NAN.
+ LSYM(Lml_n):
+ orr xh, xh, #0x7f000000
+ orr xh, xh, #0x00f80000
++#ifdef __MAVERICK__
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM "r4, r5, r6"
+
+ FUNC_END aeabi_dmul
+--- gcc-4.1.2/gcc/config/arm/ieee754-sf-original.S 2007-06-25 10:18:52.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/ieee754-sf.S 2007-06-25 10:40:25.000000000 +1000
+@@ -518,6 +518,9 @@
+ @ Check if denormalized result is possible, otherwise return signed 0.
+ cmn r2, #(24 + 1)
+ bicle r0, r0, #0x7fffffff
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RETc(le)
+
+ @ Shift value right, round, etc.
+@@ -530,6 +533,9 @@
+ adc r0, r0, #0
+ orrs r3, r3, ip, lsl #1
+ biceq r0, r0, ip, lsr #31
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RET
+
+ @ One or both arguments are denormalized.
+@@ -567,6 +573,9 @@
+ LSYM(Lml_z):
+ eor r0, r0, r1
+ bic r0, r0, #0x7fffffff
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RET
+
+ 1: @ One or both args are INF or NAN.
+@@ -595,12 +604,18 @@
+ and r0, r0, #0x80000000
+ orr r0, r0, #0x7f000000
+ orr r0, r0, #0x00800000
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RET
+
+ @ Return a quiet NAN.
+ LSYM(Lml_n):
+ orr r0, r0, #0x7f000000
+ orr r0, r0, #0x00c00000
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RET
+
+ FUNC_END aeabi_fmul
+@@ -677,6 +692,9 @@
+ adds r2, r2, #127
+ rsbgts r3, r2, #255
+ orrgt r0, r0, r2, lsl #23
++#ifdef __MAVERICK__
++ cfmvsr mvf0, r0
++#endif
+ RETc(gt)
+
+ orr r0, r0, #0x00800000
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754.patch b/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754.patch
new file mode 100644
index 0000000000..e4929fa20e
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-eabi-ieee754.patch
@@ -0,0 +1,100 @@
+--- ../gcc-cross-4.1.2-r4-unpatched/gcc-4.1.2/gcc/config/arm/ieee754-df.S 2007-06-07 13:06:52.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/ieee754-df.S 2007-06-07 13:15:49.000000000 +1000
+@@ -42,8 +42,9 @@
+
+
+ @ For FPA, float words are always big-endian.
++@ For MAVERICK, float words are always little-endian.
+ @ For VFP, floats words follow the memory system mode.
+-#if defined(__VFP_FP__) && !defined(__ARMEB__)
++#if ((defined(__VFP_FP__) && !defined(__ARMEB__)) || defined(__MAVERICK__))
+ #define xl r0
+ #define xh r1
+ #define yl r2
+@@ -451,8 +452,13 @@
+
+ orrs r2, r0, r1
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
++#if defined (__FPA_FP__)
+ mvfeqd f0, #0.0
+ #endif
++#if defined (__MAVERICK__)
++ cfstrd mvd0, #0.0
++#endif
++#endif
+ RETc(eq)
+
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
+@@ -473,8 +479,13 @@
+
+ orrs r2, r0, r1
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
++#if defined (__FPA_FP__)
+ mvfeqd f0, #0.0
+ #endif
++#if defined (__MAVERICK__)
++ cfstrd mvd0, #0.0
++#endif
++#endif
+ RETc(eq)
+
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
+@@ -526,8 +537,14 @@
+ @ Legacy code expects the result to be returned in f0. Copy it
+ @ there as well.
+ LSYM(f0_ret):
++#if defined (__FPA_FP__)
+ stmfd sp!, {r0, r1}
+ ldfd f0, [sp], #8
++#endif
++#if defined (__MAVERICK__)
++ cfmvdlr mvd0, xl
++ cfmvdhr mvd0, xh
++#endif
+ RETLDM
+
+ #endif
+--- ../gcc-cross-4.1.2-r4-unpatched/gcc-4.1.2/gcc/config/arm/ieee754-sf.S 2007-06-07 13:06:52.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/ieee754-sf.S 2007-06-07 13:21:43.000000000 +1000
+@@ -302,8 +302,13 @@
+
+ orrs r2, r0, r1
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
++#if defined (__FPA_FP__)
+ mvfeqs f0, #0.0
+ #endif
++#if defined (__MAVERICK__)
++ cfmvsr mvf0, #0.0
++#endif
++#endif
+ RETc(eq)
+
+ mov r3, #0
+@@ -314,8 +319,13 @@
+
+ orrs r2, r0, r1
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
++#if defined (__FPA_FP__)
+ mvfeqs f0, #0.0
+ #endif
++#if defined (__MAVERICK__)
++ cfmvsr mvf0, #0.0
++#endif
++#endif
+ RETc(eq)
+
+ ands r3, ah, #0x80000000 @ sign bit in r3
+@@ -387,8 +397,13 @@
+ #if !defined (__VFP_FP__) && !defined(__SOFTFP__)
+
+ LSYM(f0_ret):
++#if defined (__FPA_FP__)
+ str r0, [sp, #-4]!
+ ldfs f0, [sp], #4
++#endif
++#if defined (__MAVERICK__)
++ cfmvsr mvf0, r0
++#endif
+ RETLDM
+
+ #endif
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-eabi.patch b/packages/gcc/gcc-4.2.2/arm-crunch-eabi.patch
new file mode 100644
index 0000000000..f8992ed499
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-eabi.patch
@@ -0,0 +1,64 @@
+--- /home/hwilliams/original/gcc-4.1.2/gcc/config/arm/t-linux-eabi 2005-10-10 11:04:31.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/t-linux-eabi 2007-05-15 13:53:05.000000000 +1000
+@@ -1,11 +1,21 @@
+ # These functions are included in shared libraries.
+ TARGET_LIBGCC2_CFLAGS = -fPIC
++TARGET_LIBGCC2_CFLAGS += -mcpu=ep9312 -mfpu=maverick
++LIBGCC2_DEBUG_CFLAGS = -g0
+
+ # We do not build a Thumb multilib for Linux because the definition of
+ # CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
+ MULTILIB_OPTIONS =
+ MULTILIB_DIRNAMES =
+
++LIB1ASMSRC = arm/lib1funcs.asm
++LIB1ASMFUNCS += _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi
++
++CRTSTUFF_T_CFLAGS += -mcpu=ep9312 -mfpu=maverick
++
+ # Use a version of div0 which raises SIGFPE.
+ LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx
+
+diff -ruN arm/elf.h gcc-3.4.3/gcc/config/arm/elf.h
+--- ../gcc-4.1.2-orig/gcc/config/arm/elf.h 2004-02-24 16:25:22.000000000 +0200
++++ gcc-4.1.2/gcc/config/arm/elf.h 2005-02-10 00:31:28.000000000 +0200
+@@ -46,7 +46,7 @@
+
+ #ifndef SUBTARGET_ASM_FLOAT_SPEC
+ #define SUBTARGET_ASM_FLOAT_SPEC "\
+-%{mapcs-float:-mfloat}"
++%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa} %{mcpu=ep9312:-mfpu=maverick}"
+ #endif
+
+ #ifndef ASM_SPEC
+diff -ruN t-linux gcc-4.1.2/gcc/config/arm/t-linux
+--- t-linux 2007-05-09 16:32:28.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/t-linux 2007-05-25 11:02:17.000000000 +1000
+@@ -1,19 +1,22 @@
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference. It is then pointless adding debugging.
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
++TARGET_LIBGCC2_CFLAGS += -mcpu=ep9312 -mfpu=maverick -mfloat-abi=softfp -D__MAVERICK__
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+- _call_via_rX \
+- _fixsfsi _fixunssfsi _floatdidf _floatdisf
++ _fixsfsi _fixunssfsi
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+
+ # EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
+
++# EXTRA_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o
++CRTSTUFF_T_CFLAGS += -mcpu=ep9312 -mfpu=maverick -mfloat-abi=softfp -D__MAVERICK__
++
+ # LIBGCC = stmp-multilib
+ # INSTALL_LIBGCC = install-multilib
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable-single.patch b/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable-single.patch
new file mode 100644
index 0000000000..cdd52244a6
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable-single.patch
@@ -0,0 +1,38 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-cfcvt 2007-06-25 12:12:39.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-25 12:16:13.000000000 +1000
+@@ -301,13 +301,14 @@
+ )
+
+ ;; Convert Cirrus-SI to Cirrus-SF
++; appears to be buggy
+ (define_insn "cirrus_floatsisf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float:SF (match_operand:SI 1 "s_register_operand" "r")))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "move")]
+ )
+
+--- gcc-4.1.2/gcc/config/arm/arm.md-cfcvt 2007-06-25 12:16:53.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-25 12:18:20.000000000 +1000
+@@ -3125,14 +3125,15 @@
+
+ ;; Fixed <--> Floating conversion insns
+
++;; Maverick Crunch floatsisf2 is buggy - see cirrus.md
+ (define_expand "floatsisf2"
+ [(set (match_operand:SF 0 "s_register_operand" "")
+ (float:SF (match_operand:SI 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1]));
+ DONE;
+ }
+ ")
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable.patch b/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable.patch
new file mode 100644
index 0000000000..aa54ec3e04
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-floatsi-disable.patch
@@ -0,0 +1,61 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-cfcvt 2007-06-25 12:12:39.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-25 12:16:13.000000000 +1000
+@@ -301,21 +301,23 @@
+ )
+
+ ;; Convert Cirrus-SI to Cirrus-SF
++; appears to be buggy
+ (define_insn "cirrus_floatsisf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (float:SF (match_operand:SI 1 "s_register_operand" "r")))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "move")]
+ )
+
++;appears to be buggy
+ (define_insn "cirrus_floatsidf2"
+ [(set (match_operand:DF 0 "cirrus_fp_register" "=v")
+ (float:DF (match_operand:SI 1 "s_register_operand" "r")))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "move")]
+--- gcc-4.1.2/gcc/config/arm/arm.md-cfcvt 2007-06-25 12:16:53.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-25 12:18:20.000000000 +1000
+@@ -3125,24 +3125,26 @@
+
+ ;; Fixed <--> Floating conversion insns
+
++;; Maverick Crunch floatsisf2 is buggy - see cirrus.md
+ (define_expand "floatsisf2"
+ [(set (match_operand:SF 0 "s_register_operand" "")
+ (float:SF (match_operand:SI 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1]));
+ DONE;
+ }
+ ")
+
++;; Maverick Crunch floatsidf2 is buggy - see cirrus.md
+ (define_expand "floatsidf2"
+ [(set (match_operand:DF 0 "s_register_operand" "")
+ (float:DF (match_operand:SI 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+- if (TARGET_MAVERICK)
++ if (TARGET_MAVERICK && 0)
+ {
+ emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1]));
+ DONE;
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-floatunsidf.patch b/packages/gcc/gcc-4.2.2/arm-crunch-floatunsidf.patch
new file mode 100644
index 0000000000..2fe2254db9
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-floatunsidf.patch
@@ -0,0 +1,37 @@
+--- gcc-4.1.2/gcc/config/arm/ieee754-df-original.S 2007-06-25 14:05:35.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/ieee754-df.S 2007-06-25 14:08:03.000000000 +1000
+@@ -382,6 +382,8 @@
+ FUNC_END aeabi_dadd
+ FUNC_END adddf3
+
++#ifndef __MAVERICK__ /* THIS IS A BAD HACK */
++
+ ARM_FUNC_START floatunsidf
+ ARM_FUNC_ALIAS aeabi_ui2d floatunsidf
+
+@@ -401,8 +403,14 @@
+ FUNC_END aeabi_ui2d
+ FUNC_END floatunsidf
+
++#endif
++
+ ARM_FUNC_START floatsidf
+ ARM_FUNC_ALIAS aeabi_i2d floatsidf
++#ifdef __MAVERICK__ /* THIS IS A BAD HACK */
++ARM_FUNC_ALIAS floatunsidf floatsidf
++ARM_FUNC_ALIAS aeabi_ui2d floatsidf
++#endif
+
+ teq r0, #0
+ moveq r1, #0
+@@ -418,6 +426,10 @@
+ mov xh, #0
+ b LSYM(Lad_l)
+
++#ifdef __MAVERICK__ /* THIS IS A BAD HACK */
++ FUNC_END aeabi_ui2d floatsidf
++ FUNC_END floatunsidf floatsidf
++#endif
+ FUNC_END aeabi_i2d
+ FUNC_END floatsidf
+
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-fp_consts.patch b/packages/gcc/gcc-4.2.2/arm-crunch-fp_consts.patch
new file mode 100644
index 0000000000..5f289bbebe
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-fp_consts.patch
@@ -0,0 +1,13 @@
+--- gcc-4.1.2/gcc/config/arm/arm.c-original 2007-06-12 16:17:14.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-06-12 16:17:28.000000000 +1000
+@@ -5218,7 +5218,9 @@
+ int i;
+ REAL_VALUE_TYPE r;
+
++ if (TARGET_MAVERICK)
++ fp_consts_inited = 0;
+- if (TARGET_VFP)
++ else if (TARGET_VFP)
+ fp_consts_inited = 1;
+ else
+ fp_consts_inited = 8;
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-neg.patch b/packages/gcc/gcc-4.2.2/arm-crunch-neg.patch
new file mode 100644
index 0000000000..f14ae0190e
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-neg.patch
@@ -0,0 +1,30 @@
+WARNING: adding this patch causes copysign1.c and mzero3.c to fail...
+diff -urN gcc-4.1.2/gcc/config/arm/arm.md-original gcc-4.1.2/gcc/config/arm/arm.md
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-12 12:48:14.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-12 12:49:53.000000000 +1000
+@@ -2985,14 +2985,14 @@
+ (define_expand "negsf2"
+ [(set (match_operand:SF 0 "s_register_operand" "")
+ (neg:SF (match_operand:SF 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ ""
+ )
+
+ (define_expand "negdf2"
+ [(set (match_operand:DF 0 "s_register_operand" "")
+ (neg:DF (match_operand:DF 1 "s_register_operand" "")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "")
+
+ ;; abssi2 doesn't really clobber the condition codes if a different register
+@@ -4097,7 +4097,7 @@
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m")
+ (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,r"))]
+ "TARGET_ARM
+- && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP))
++ && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP || TARGET_MAVERICK))
+ && !TARGET_IWMMXT"
+ "*
+ switch (which_alternative)
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-neg2.patch b/packages/gcc/gcc-4.2.2/arm-crunch-neg2.patch
new file mode 100644
index 0000000000..4fd91f3215
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-neg2.patch
@@ -0,0 +1,25 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-original 2007-06-12 17:01:24.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-12 17:03:26.000000000 +1000
+@@ -255,18 +256,20 @@
+ [(set_attr "cirrus" "normal")]
+ )
+
++;; appears to be buggy: neg 0 != -0
+ (define_insn "*cirrus_negsf2"
+ [(set (match_operand:SF 0 "cirrus_fp_register" "=v")
+ (neg:SF (match_operand:SF 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfnegs%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")]
+ )
+
++;; appears to be buggy: neg 0 != -0
+ (define_insn "*cirrus_negdf2"
+ [(set (match_operand:DF 0 "cirrus_fp_register" "=v")
+ (neg:DF (match_operand:DF 1 "cirrus_fp_register" "v")))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cfnegd%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")]
+ )
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-offset.patch b/packages/gcc/gcc-4.2.2/arm-crunch-offset.patch
new file mode 100644
index 0000000000..3a40f0d224
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-offset.patch
@@ -0,0 +1,20 @@
+--- gcc-4.1.2/gcc/config/arm/arm.c-original 2007-06-12 14:46:20.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-06-12 14:48:06.000000000 +1000
+@@ -3460,7 +3460,7 @@
+
+ use_ldrd = (TARGET_LDRD
+ && (mode == DImode
+- || (mode == DFmode && (TARGET_SOFT_FLOAT || TARGET_VFP))));
++ || (mode == DFmode && (TARGET_SOFT_FLOAT || TARGET_MAVERICK || TARGET_VFP))));
+
+ if (code == POST_INC || code == PRE_DEC
+ || ((code == PRE_INC || code == POST_DEC)
+@@ -3960,7 +3960,7 @@
+ /* VFP addressing modes actually allow greater offsets, but for
+ now we just stick with the lowest common denominator. */
+ if (mode == DImode
+- || ((TARGET_SOFT_FLOAT || TARGET_VFP) && mode == DFmode))
++ || ((TARGET_SOFT_FLOAT || TARGET_MAVERICK || TARGET_VFP) && mode == DFmode))
+ {
+ low_n = n & 0x0f;
+ n &= ~0x0f;
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-predicates.patch b/packages/gcc/gcc-4.2.2/arm-crunch-predicates.patch
new file mode 100644
index 0000000000..4841ff8178
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-predicates.patch
@@ -0,0 +1,20 @@
+diff -urN gcc-4.1.2/gcc/config/arm/predicates.md ../../../../old-tmp/work/arm-oabi-angstrom-linux/gcc-cross-4.1.2-backup/gcc-4.1.2/gcc/config/arm/predicates.md
+--- gcc-4.1.2/gcc/config/arm/predicates.md 2005-09-11 17:38:02.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/predicates.md 2007-05-30 12:15:54.000000000 +1000
+@@ -171,8 +171,14 @@
+ (match_code "eq,ne"))
+
+ ;; True for comparisons other than LTGT or UNEQ.
++(define_special_predicate "arm_comparison_operator"
++; (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt")) ;; original - no LTGT or UNEQ
++; (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltgt,ltu,unordered,ordered,uneq,unlt,unle,unge,ungt")) ;; everything?
++;; True for comparisons other than GE, GEU, UNLT, unordered or ordered. - Cirrus Version - must include ge?
+-(define_special_predicate "arm_comparison_operator"
++;(define_special_predicate "arm_comparison_operator"
+- (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt"))
++(match_code "eq,ne,le,lt,ge,geu,gt,gtu,leu,ltgt,ltu,uneq,unle,unge,ungt")) ;; bad codes removed?
++;(match_code "eq,ne,le,lt,gt,gtu,leu,ltgt,ltu,uneq,unle,unge,ungt")) ;; bad codes removed + ge / geu removed
++
+
+ (define_special_predicate "minmax_operator"
+ (and (match_code "smin,smax,umin,umax")
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-predicates2.patch b/packages/gcc/gcc-4.2.2/arm-crunch-predicates2.patch
new file mode 100644
index 0000000000..3e01158fe1
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-predicates2.patch
@@ -0,0 +1,10 @@
+--- gcc-4.1.2/gcc/config/arm/predicates.md-original 2007-06-13 12:25:35.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/predicates.md 2007-06-13 12:25:42.000000000 +1000
+@@ -206,7 +206,6 @@
+ || mode == CC_DEQmode
+ || mode == CC_DLEmode
+ || mode == CC_DLTmode
+- || mode == CC_DGEmode
+ || mode == CC_DGTmode
+ || mode == CC_DLEUmode
+ || mode == CC_DLTUmode
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-predicates3.patch b/packages/gcc/gcc-4.2.2/arm-crunch-predicates3.patch
new file mode 100644
index 0000000000..99e1e6c88c
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-predicates3.patch
@@ -0,0 +1,116 @@
+diff -urN ../gcc-cross-4.1.2-r4/gcc-4.1.2/gcc/config/arm/arm.md gcc-4.1.2/gcc/config/arm/arm.md
+--- ../gcc-cross-4.1.2-r4/gcc-4.1.2/gcc/config/arm/arm.md 2007-06-14 11:50:53.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-14 11:43:17.000000000 +1000
+@@ -7488,6 +7488,22 @@
+ arm_compare_op1);"
+ )
+
++;(define_expand "suneq"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (uneq:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++; "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0,
++; arm_compare_op1);"
++;)
++
++;(define_expand "sltgt"
++; [(set (match_operand:SI 0 "s_register_operand" "")
++; (ltgt:SI (match_dup 1) (const_int 0)))]
++; "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_MAVERICK)"
++; "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0,
++; arm_compare_op1);"
++;)
++
+ ;;; DO NOT add patterns for SUNEQ or SLTGT, these can't be represented with
+ ;;; simple ARM instructions.
+ ;
+@@ -10284,13 +10284,73 @@
+ "TARGET_ARM && arm_arch5e"
+ "pld\\t%a0")
+
++;; Special predication pattern for Maverick Crunch floating-point
++
++(define_cond_exec
++ [(match_operator 0 "maverick_comparison_operator"
++ [(match_operand:CCFP 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++;; Special predication pattern for Maverick Crunch - !CCFP
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC_NOOV 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC_Z 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC_SWP 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC_C 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC_N 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
++(define_cond_exec
++ [(match_operator 0 "arm_comparison_operator"
++ [(match_operand:CC 1 "cc_register" "")
++ (const_int 0)])]
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ ""
++)
++
+ ;; General predication pattern
+
+ (define_cond_exec
+ [(match_operator 0 "arm_comparison_operator"
+ [(match_operand 1 "cc_register" "")
+ (const_int 0)])]
+- "TARGET_ARM"
++ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
+ ""
+ )
+
+diff -urN ../gcc-cross-4.1.2-r4/gcc-4.1.2/gcc/config/arm/predicates.md gcc-4.1.2/gcc/config/arm/predicates.md
+--- ../gcc-cross-4.1.2-r4/gcc-4.1.2/gcc/config/arm/predicates.md 2005-09-11 17:38:02.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/predicates.md 2007-06-14 11:46:13.000000000 +1000
+@@ -172,7 +172,11 @@
+
+ ;; True for comparisons other than LTGT or UNEQ.
+ (define_special_predicate "arm_comparison_operator"
+ (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt"))
++
++;; True for comparisons other than GE, GEU, UNLT, UNORDERED or ORDERED - TODO add LTGT and UNEQ - needs extra support elsewhere
++(define_special_predicate "maverick_comparison_operator"
++(match_code "eq,ne,le,lt,gt,gtu,leu,ltu,unle,unge,ungt"))
+
+ (define_special_predicate "minmax_operator"
+ (and (match_code "smin,smax,umin,umax")
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-saveregs.patch b/packages/gcc/gcc-4.2.2/arm-crunch-saveregs.patch
new file mode 100644
index 0000000000..531ae86610
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-saveregs.patch
@@ -0,0 +1,153 @@
+diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c gcc-4.1.2/gcc/config/arm/arm.c
+--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c 2007-05-09 16:32:29.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.c 2007-05-15 09:39:41.000000000 +1000
+@@ -426,7 +435,7 @@
+ #define FL_STRONG (1 << 8) /* StrongARM */
+ #define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */
+ #define FL_XSCALE (1 << 10) /* XScale */
+-#define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */
++#define FL_CIRRUS (1 << 11) /* Cirrus Crunch coprocessor. */
+ #define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds
+ media instructions. */
+ #define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */
+@@ -490,7 +499,7 @@
+ /* Nonzero if this chip is a StrongARM. */
+ int arm_tune_strongarm = 0;
+
+-/* Nonzero if this chip is a Cirrus variant. */
++/* Nonzero if this chip supports Cirrus Crunch coprocessor. */
+ int arm_arch_cirrus = 0;
+
+ /* Nonzero if this chip supports Intel Wireless MMX technology. */
+@@ -1184,7 +1193,8 @@
+ else
+ */
+ if (arm_arch_cirrus)
+- arm_fpu_arch = FPUTYPE_MAVERICK;
++ /* Cirrus crunch coprocessor still requires soft-float division. */
++ arm_fpu_arch = FPUTYPE_MAVERICK;
+ else
+ arm_fpu_arch = FPUTYPE_FPA_EMU2;
+ #endif
+@@ -1567,6 +1577,9 @@
+ if (regs_ever_live[regno] && !call_used_regs[regno])
+ return 0;
+
++ if (TARGET_MAVERICK)
++ return 0;
++
+ if (TARGET_REALLY_IWMMXT)
+ for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
+ if (regs_ever_live[regno] && ! call_used_regs [regno])
+@@ -9775,7 +9886,19 @@
+ /* This variable is for the Virtual Frame Pointer, not VFP regs. */
+ int vfp_offset = offsets->frame;
+
+- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
++ if (arm_fpu_arch == FPUTYPE_MAVERICK)
++ {
++ for (reg = LAST_CIRRUS_FP_REGNUM; reg >= FIRST_CIRRUS_FP_REGNUM; reg--)
++ if (regs_ever_live[reg] && !call_used_regs[reg])
++ {
++ floats_offset += 8; /* more problems - futaris? */
++ /* if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1) */
++ asm_fprintf (f, "\tnop\n");
++ asm_fprintf (f, "\tcfldrd\tmvd%d, [%r, #-%d]\n",
++ reg - FIRST_CIRRUS_FP_REGNUM, FP_REGNUM, floats_offset - vfp_offset);
++ }
++ }
++ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ {
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
+ if (regs_ever_live[reg] && !call_used_regs[reg])
+@@ -9924,7 +10047,18 @@
+ output_add_immediate (operands);
+ }
+
+- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
++ if (arm_fpu_arch == FPUTYPE_MAVERICK)
++ { /* order changed - futaris */
++ for (reg = FIRST_CIRRUS_FP_REGNUM; reg <= LAST_CIRRUS_FP_REGNUM; reg++)
++ if (regs_ever_live[reg] && !call_used_regs[reg])
++ {
++ /* if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1) */
++ asm_fprintf (f, "\tnop\n");
++ asm_fprintf (f, "\tcfldrd\tmvd%u, [%r], #8\n",
++ reg - FIRST_CIRRUS_FP_REGNUM, SP_REGNUM);
++ } /* reg problems - futaris */
++ }
++ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ {
+ for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
+ if (regs_ever_live[reg] && !call_used_regs[reg])
+@@ -10429,9 +10563,19 @@
+ if (! IS_VOLATILE (func_type))
+ {
++ /* Space for saved MAVERICK registers. */
++ if (arm_fpu_arch == FPUTYPE_MAVERICK)
++ {
++ for (regno = FIRST_CIRRUS_FP_REGNUM; regno <= LAST_CIRRUS_FP_REGNUM; regno++)
++ if (regs_ever_live[regno] && !call_used_regs[regno])
++ saved += 8; // 8 in 3.4.3 patch - futaris;
++ }
++ else
+ /* Space for saved FPA registers. */
++ {
+ for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++)
+ if (regs_ever_live[regno] && ! call_used_regs[regno])
+ saved += 12;
++ }
+
+ /* Space for saved VFP registers. */
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+@@ -10739,7 +10882,19 @@
+
+ /* Save any floating point call-saved registers used by this
+ function. */
+- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
++ if (arm_fpu_arch == FPUTYPE_MAVERICK)
++ {
++ for (reg = LAST_CIRRUS_FP_REGNUM; reg >= FIRST_CIRRUS_FP_REGNUM; reg--)
++ if (regs_ever_live[reg] && !call_used_regs[reg])
++ {
++ insn = gen_rtx_PRE_DEC (DFmode, stack_pointer_rtx); /* think these causes problems */
++ insn = gen_rtx_MEM (DFmode, insn);
++ insn = emit_insn (gen_rtx_SET (VOIDmode, insn,
++ gen_rtx_REG (DFmode, reg)));
++ RTX_FRAME_RELATED_P (insn) = 1; saved_regs += 8; /* added by futaris */
++ }
++ }
++ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ {
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
+ if (regs_ever_live[reg] && !call_used_regs[reg])
+@@ -15179,6 +15331,9 @@
+ if (IS_FPA_REGNUM (regno))
+ return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM;
+
++ if (IS_CIRRUS_REGNUM (regno))
++ return 28 + regno - FIRST_CIRRUS_FP_REGNUM;
++
+ if (IS_VFP_REGNUM (regno))
+ return 64 + regno - FIRST_VFP_REGNUM;
+
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-28 15:42:36.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-28 15:42:48.000000000 +1000
+@@ -9800,7 +9800,7 @@
+ return arm_output_epilogue (next_nonnote_insn (insn));
+ "
+ ;; Length is absolute worst case
+- [(set_attr "length" "44")
++ [(set_attr "length" "108")
+ (set_attr "type" "block")
+ ;; We don't clobber the conditions, but the potential length of this
+ ;; operation is sufficient to make conditionalizing the sequence
+@@ -9818,7 +9818,7 @@
+ return thumb_unexpanded_epilogue ();
+ "
+ ; Length is absolute worst case
+- [(set_attr "length" "44")
++ [(set_attr "length" "108")
+ (set_attr "type" "block")
+ ;; We don't clobber the conditions, but the potential length of this
+ ;; operation is sufficient to make conditionalizing the sequence
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-scc.patch b/packages/gcc/gcc-4.2.2/arm-crunch-scc.patch
new file mode 100644
index 0000000000..d1330f2543
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-scc.patch
@@ -0,0 +1,38 @@
+--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-13 12:38:06.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-13 12:40:07.000000000 +1000
+@@ -7375,7 +7375,7 @@
+ (define_expand "sge"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ge:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
++ "TARGET_ARM"
+ "operands[1] = arm_gen_compare_reg (GE, arm_compare_op0, arm_compare_op1);"
+ )
+
+@@ -7434,7 +7434,7 @@
+ (define_expand "sunordered"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unordered:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7442,7 +7442,7 @@
+ (define_expand "sordered"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (ordered:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
+ arm_compare_op1);"
+ )
+@@ -7467,7 +7467,7 @@
+ (define_expand "sunlt"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (unlt:SI (match_dup 1) (const_int 0)))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP || TARGET_MAVERICK)"
+ "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0,
+ arm_compare_op1);"
+ )
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable-new.patch b/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable-new.patch
new file mode 100644
index 0000000000..6dea43fa7c
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable-new.patch
@@ -0,0 +1,33 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-cfcvt 2007-06-25 12:46:22.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-25 12:46:41.000000000 +1000
+@@ -337,13 +337,14 @@
+ "cfcvt64d%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
++; appears to be buggy
+ (define_insn "cirrus_truncsfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v"))))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "normal")]
+ )
+
+--- gcc-4.1.2/gcc/config/arm/arm.md-cfcvt 2007-06-25 12:46:56.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-25 12:48:08.000000000 +1000
+@@ -3151,10 +3151,11 @@
+ }
+ ")
+
++; appears to be buggy for MAVERICK
+ (define_expand "fix_truncsfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+ if (TARGET_MAVERICK)
+ {
diff --git a/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable.patch b/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable.patch
new file mode 100644
index 0000000000..a5d791a0a4
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-crunch-truncsi-disable.patch
@@ -0,0 +1,56 @@
+--- gcc-4.1.2/gcc/config/arm/cirrus.md-cfcvt 2007-06-25 12:46:22.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/cirrus.md 2007-06-25 12:46:41.000000000 +1000
+@@ -337,21 +337,23 @@
+ "cfcvt64d%?\\t%V0, %V1"
+ [(set_attr "cirrus" "normal")])
+
++; appears to be buggy
+ (define_insn "cirrus_truncsfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v"))))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "normal")]
+ )
+
++; appears to be buggy
+ (define_insn "cirrus_truncdfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v"))))
+ (clobber (match_scratch:DF 2 "=v"))]
+- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
++ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
+ "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
+ [(set_attr "length" "8")
+ (set_attr "cirrus" "normal")]
+--- gcc-4.1.2/gcc/config/arm/arm.md-cfcvt 2007-06-25 12:46:56.000000000 +1000
++++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-25 12:48:08.000000000 +1000
+@@ -3151,10 +3151,11 @@
+ }
+ ")
+
++; appears to be buggy for MAVERICK
+ (define_expand "fix_truncsfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+ if (TARGET_MAVERICK)
+ {
+@@ -3167,10 +3168,11 @@
+ }
+ ")
+
++; appears to be buggy for MAVERICK
+ (define_expand "fix_truncdfsi2"
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))]
+- "TARGET_ARM && TARGET_HARD_FLOAT"
++ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
+ "
+ if (TARGET_MAVERICK)
+ {
diff --git a/packages/gcc/gcc-4.2.2/arm-nolibfloat.patch b/packages/gcc/gcc-4.2.2/arm-nolibfloat.patch
new file mode 100644
index 0000000000..c4897c0330
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-nolibfloat.patch
@@ -0,0 +1,24 @@
+# Dimitry Andric <dimitry@andric.com>, 2004-05-01
+#
+# * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed
+# anymore. (The required functions are now in libgcc.)
+#
+# Fixes errors like
+# arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat
+# collect2: ld returned 1 exit status
+# make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1
+# when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat
+
+Index: gcc-4.0.2/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/linux-elf.h 2005-03-04 16:14:01.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/linux-elf.h 2005-11-11 18:02:54.000000000 +0000
+@@ -56,7 +56,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
diff --git a/packages/gcc/gcc-4.2.2/arm-softfloat.patch b/packages/gcc/gcc-4.2.2/arm-softfloat.patch
new file mode 100644
index 0000000000..c86c83ed15
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-softfloat.patch
@@ -0,0 +1,16 @@
+Index: gcc-4.0.2/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.0.2.orig/gcc/config/arm/t-linux 2004-05-15 12:41:35.000000000 +0000
++++ gcc-4.0.2/gcc/config/arm/t-linux 2005-11-11 16:07:53.000000000 +0000
+@@ -4,7 +4,10 @@
+ LIBGCC2_DEBUG_CFLAGS = -g0
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/packages/gcc/gcc-4.2.2/arm-thumb-cache.patch b/packages/gcc/gcc-4.2.2/arm-thumb-cache.patch
new file mode 100644
index 0000000000..fa63846c8c
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-thumb-cache.patch
@@ -0,0 +1,29 @@
+--- gcc-4.1.1/gcc/config/arm/linux-gas.h- 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.1.1/gcc/config/arm/linux-gas.h 2006-06-18 10:23:46.000000000 +0200
+@@ -44,6 +44,7 @@
+
+ /* Clear the instruction cache from `beg' to `end'. This makes an
+ inline system call to SYS_cacheflush. */
++#if !defined(__thumb__)
+ #define CLEAR_INSN_CACHE(BEG, END) \
+ { \
+ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
+@@ -53,3 +54,18 @@
+ : "=r" (_beg) \
+ : "0" (_beg), "r" (_end), "r" (_flg)); \
+ }
++#else
++#define CLEAR_INSN_CACHE(BEG, END) \
++{ \
++ register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \
++ register unsigned long _end __asm ("a2") = (unsigned long) (END); \
++ register unsigned long _flg __asm ("a3") = 0; \
++ register unsigned long _swi __asm ("a4") = 0xf0002; \
++ __asm __volatile ("push {r7}\n" \
++ " mov r7,a4\n" \
++ " swi 0 @ sys_cacheflush\n" \
++ " pop {r7}\n" \
++ : "=r" (_beg) \
++ : "0" (_beg), "r" (_end), "r" (_flg), "r" (_swi)); \
++}
++#endif
diff --git a/packages/gcc/gcc-4.2.2/arm-thumb.patch b/packages/gcc/gcc-4.2.2/arm-thumb.patch
new file mode 100644
index 0000000000..69e2f68cf2
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/arm-thumb.patch
@@ -0,0 +1,64 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- gcc-4.1.1/gcc/config/arm/lib1funcs.asm~gcc
++++ gcc-4.1.1/gcc/config/arm/lib1funcs.asm
+@@ -995,10 +995,24 @@
+ .code 32
+ FUNC_START div0
+
++#if ! defined __thumb__
+ stmfd sp!, {r1, lr}
+ mov r0, #SIGFPE
+ bl SYM(raise) __PLT__
+ RETLDM r1
++#else
++ push {r1, lr}
++ mov r0, #SIGFPE
++ bl SYM(raise) __PLT__
++#if __ARM_ARCH__ > 4
++ pop {r1, pc}
++#else
++ @ on 4T that won't work
++ pop {r1}
++ pop {r3}
++ bx r3
++#endif
++#endif
+
+ FUNC_END div0
+
+@@ -1141,11 +1155,12 @@
+ code here switches to the correct mode before executing the function. */
+
+ .text
+- .align 0
++ .align 1
+ .force_thumb
+
+ .macro call_via register
+ THUMB_FUNC_START _call_via_\register
++ .hidden SYM (_call_via_\register)
+
+ bx \register
+ nop
+@@ -1242,6 +1257,7 @@
+ .code 16
+
+ THUMB_FUNC_START _interwork_call_via_\register
++ .hidden SYM (_interwork_call_via_\register)
+
+ bx pc
+ nop
+--- gcc-4.1.1/gcc/config/arm/t-linux~gcc
++++ gcc-4.1.1/gcc/config/arm/t-linux
+@@ -7,6 +7,7 @@
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _call_via_rX \
+ _fixsfsi _fixunssfsi _floatdidf _floatdisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
diff --git a/packages/gcc/gcc-4.2.2/cache-amnesia.patch b/packages/gcc/gcc-4.2.2/cache-amnesia.patch
new file mode 100644
index 0000000000..ef7cd111c5
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/cache-amnesia.patch
@@ -0,0 +1,13 @@
+diff --git a/gcc/configure b/gcc/configure
+index 44620ab..6e1830c 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -12272,7 +12272,7 @@ else
+ esac
+ saved_CFLAGS="${CFLAGS}"
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+- ${realsrcdir}/configure \
++ CONFIG_SITE= ${realsrcdir}/configure --cache-file=./other.cache \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+ CFLAGS="${saved_CFLAGS}"
diff --git a/packages/gcc/gcc-4.2.2/fix-ICE-in-arm_unwind_emit_set.diff b/packages/gcc/gcc-4.2.2/fix-ICE-in-arm_unwind_emit_set.diff
new file mode 100644
index 0000000000..568e15abff
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/fix-ICE-in-arm_unwind_emit_set.diff
@@ -0,0 +1,18 @@
+--- trunk/gcc/config/arm/arm.c 2006/09/19 13:18:27 117055
++++ trunk/gcc/config/arm/arm.c 2006/09/19 13:19:24 117056
+@@ -15415,6 +15415,15 @@
+ /* Move from sp to reg. */
+ asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
+ }
++ else if (GET_CODE (e1) == PLUS
++ && GET_CODE (XEXP (e1, 0)) == REG
++ && REGNO (XEXP (e1, 0)) == SP_REGNUM
++ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
++ {
++ /* Set reg to offset from sp. */
++ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
++ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
++ }
+ else
+ abort ();
+ break;
diff --git a/packages/gcc/gcc-4.2.2/gcc41-configure.in.patch b/packages/gcc/gcc-4.2.2/gcc41-configure.in.patch
new file mode 100644
index 0000000000..3d33bcb978
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/gcc41-configure.in.patch
@@ -0,0 +1,22 @@
+--- gcc-3.4.4/configure.in.orig 2005-08-09 19:57:51.504323183 -0700
++++ gcc-3.4.4/configure.in 2005-08-09 20:00:12.073168623 -0700
+@@ -1907,7 +1907,7 @@
+ *) gxx_include_dir=${with_gxx_include_dir} ;;
+ esac
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--- gcc-3.4.4/configure.orig 2005-08-09 21:02:29.668360660 -0700
++++ gcc-3.4.4/configure 2005-08-09 21:02:50.157649970 -0700
+@@ -2669,7 +2669,7 @@
+ *) gxx_include_dir=${with_gxx_include_dir} ;;
+ esac
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
diff --git a/packages/gcc/gcc-4.2.2/ldflags.patch b/packages/gcc/gcc-4.2.2/ldflags.patch
new file mode 100644
index 0000000000..9576f60778
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/ldflags.patch
@@ -0,0 +1,22 @@
+--- /tmp/Makefile.in 2006-02-23 20:56:01.399758728 +0100
++++ gcc-4.1-20060217/Makefile.in 2006-02-23 20:56:16.874406224 +0100
+@@ -334,7 +334,7 @@
+ CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+-LDFLAGS_FOR_TARGET =
++LDFLAGS_FOR_TARGET = @LDFLAGS@
+ PICFLAG_FOR_TARGET =
+
+ # ------------------------------------
+--- /tmp/Makefile.tpl 2006-02-23 20:50:34.077519272 +0100
++++ gcc-4.1-20060217/Makefile.tpl 2006-02-23 21:04:31.092273688 +0100
+@@ -337,7 +337,7 @@
+ CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+-LDFLAGS_FOR_TARGET =
++LDFLAGS_FOR_TARGET = @LDFLAGS@
+ PICFLAG_FOR_TARGET =
+
+ # ------------------------------------
diff --git a/packages/gcc/gcc-4.2.2/sdk-libstdc++-includes.patch b/packages/gcc/gcc-4.2.2/sdk-libstdc++-includes.patch
new file mode 100644
index 0000000000..4377c2143b
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/sdk-libstdc++-includes.patch
@@ -0,0 +1,22 @@
+--- gcc-3.4.1/libstdc++-v3/libmath/Makefile.am~ 2003-08-27 22:29:42.000000000 +0100
++++ gcc-3.4.1/libstdc++-v3/libmath/Makefile.am 2004-07-22 16:41:45.152130128 +0100
+@@ -32,7 +32,7 @@
+
+ libmath_la_SOURCES = stubs.c
+
+-AM_CPPFLAGS = $(CANADIAN_INCLUDES)
++AM_CPPFLAGS = $(CANADIAN_INCLUDES) -I$(toplevel_srcdir)/include
+
+ # Only compiling "C" sources in this directory.
+ LIBTOOL = @LIBTOOL@ --tag CC
+--- gcc-3.4.1/libstdc++-v3/fragment.am.old 2004-07-22 18:24:58.024083656 +0100
++++ gcc-3.4.1/libstdc++-v3/fragment.am 2004-07-22 18:24:59.019932264 +0100
+@@ -18,7 +18,7 @@
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+ # -I/-D flags to pass when compiling.
+-AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
++AM_CPPFLAGS = $(GLIBCXX_INCLUDES) -I$(toplevel_srcdir)/include
+
+
+
diff --git a/packages/gcc/gcc-4.2.2/sh3-installfix-fixheaders.patch b/packages/gcc/gcc-4.2.2/sh3-installfix-fixheaders.patch
new file mode 100644
index 0000000000..a06cd2e075
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/sh3-installfix-fixheaders.patch
@@ -0,0 +1,11 @@
+--- gcc-4.1.1/gcc/Makefile.in_orig 2007-01-31 21:24:23.000000000 +0000
++++ gcc-4.1.1/gcc/Makefile.in 2007-01-31 21:24:43.000000000 +0000
+@@ -3772,8 +3772,6 @@
+ $(INSTALL_SCRIPT) $(mkinstalldirs) \
+ $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
+ $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
+- $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \
+- $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
+ else :; fi
+ echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
+ > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
diff --git a/packages/gcc/gcc-4.2.2/unbreak-armv4t.patch b/packages/gcc/gcc-4.2.2/unbreak-armv4t.patch
new file mode 100644
index 0000000000..b3399abfdb
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/unbreak-armv4t.patch
@@ -0,0 +1,12 @@
+diff -urN gcc-4.1.1/gcc/config/arm/linux-eabi.h gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h
+--- gcc-4.1.1/gcc/config/arm/linux-eabi.h 2006-10-22 11:11:49.000000000 -0700
++++ gcc-4.1.1-arm9tdmi/gcc/config/arm/linux-eabi.h 2006-10-24 21:34:01.000000000 -0700
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+ #define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
diff --git a/packages/gcc/gcc-4.2.2/zecke-no-host-includes.patch b/packages/gcc/gcc-4.2.2/zecke-no-host-includes.patch
new file mode 100644
index 0000000000..6afb10d6ef
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/zecke-no-host-includes.patch
@@ -0,0 +1,31 @@
+Index: gcc-4.0.2/gcc/c-incpath.c
+===================================================================
+--- gcc-4.0.2.orig/gcc/c-incpath.c 2005-01-23 16:05:27.000000000 +0100
++++ gcc-4.0.2/gcc/c-incpath.c 2006-05-15 21:23:02.000000000 +0200
+@@ -350,6 +350,26 @@
+ p->construct = 0;
+ p->user_supplied_p = user_supplied_p;
+
++#ifdef CROSS_COMPILE
++ /* A common error when cross compiling is including
++ host headers. This code below will try to fail fast
++ for cross compiling. Currently we consider /usr/include,
++ /opt/include and /sw/include as harmful. */
++ {
++ /* printf("Adding Path: %s\n", p->name ); */
++ if( strstr(p->name, "/usr/include" ) == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /usr/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ } else if( strstr(p->name, "/sw/include") == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /sw/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ } else if( strstr(p->name, "/opt/include") == p->name ) {
++ fprintf(stderr, _("CROSS COMPILE Badness: /opt/include in INCLUDEPATH: %s\n"), p->name);
++ abort();
++ }
++ }
++#endif
++
+ add_cpp_dir_path (p, chain);
+ }
+
diff --git a/packages/gcc/gcc-4.2.2/zecke-xgcc-cpp.patch b/packages/gcc/gcc-4.2.2/zecke-xgcc-cpp.patch
new file mode 100644
index 0000000000..42ec190600
--- /dev/null
+++ b/packages/gcc/gcc-4.2.2/zecke-xgcc-cpp.patch
@@ -0,0 +1,12 @@
+Index: gcc-4.1.1/Makefile.in
+===================================================================
+--- gcc-4.1.1.orig/Makefile.in 2006-08-06 13:32:44.000000000 +0200
++++ gcc-4.1.1/Makefile.in 2006-08-06 13:32:46.000000000 +0200
+@@ -194,6 +194,7 @@
+ AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
++ CPP="$(CC_FOR_TARGET) -E"; export CCP; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
diff --git a/packages/gcc/gcc-cross-initial_4.2.2.bb b/packages/gcc/gcc-cross-initial_4.2.2.bb
new file mode 100644
index 0000000000..1c1d094382
--- /dev/null
+++ b/packages/gcc/gcc-cross-initial_4.2.2.bb
@@ -0,0 +1,5 @@
+require gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
+
+EXTRA_OECONF += "--disable-libmudflap \
+ --disable-libssp"
diff --git a/packages/gcc/gcc-cross_4.2.1.bb b/packages/gcc/gcc-cross_4.2.1.bb
index e67d6c6b7a..3272876326 100644
--- a/packages/gcc/gcc-cross_4.2.1.bb
+++ b/packages/gcc/gcc-cross_4.2.1.bb
@@ -5,7 +5,7 @@ inherit cross
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
# NOTE: split PR. If the main .oe changes something that affects its *build*
# remember to increment this one too.
-PR = "r8"
+PR = "r9"
DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc gmp-native mpfr-native"
PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
diff --git a/packages/gcc/gcc-cross_4.2.2.bb b/packages/gcc/gcc-cross_4.2.2.bb
new file mode 100644
index 0000000000..9025a98f3c
--- /dev/null
+++ b/packages/gcc/gcc-cross_4.2.2.bb
@@ -0,0 +1,20 @@
+require gcc_${PV}.bb
+# path mangling, needed by the cross packaging
+require gcc-paths-cross.inc
+inherit cross
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"
+# NOTE: split PR. If the main .oe changes something that affects its *build*
+# remember to increment this one too.
+PR = "r1"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc gmp-native mpfr-native"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+# cross build
+require gcc3-build-cross.inc
+# cross packaging
+require gcc-package-cross.inc
+
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+
+EXTRA_OECONF += "--disable-libunwind-exceptions --with-mpfr=${STAGING_DIR}/${BUILD_SYS}"
diff --git a/packages/gcc/gcc_4.2.1.bb b/packages/gcc/gcc_4.2.1.bb
index d11f2460ae..7bf074de57 100644
--- a/packages/gcc/gcc_4.2.1.bb
+++ b/packages/gcc/gcc_4.2.1.bb
@@ -38,6 +38,7 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
file://unbreak-armv4t.patch;patch=1 \
file://fix-ICE-in-arm_unwind_emit_set.diff;patch=1 \
file://cache-amnesia.patch;patch=1 \
+ file://gfortran.patch;patch=1 \
"
SRC_URI_append_ep93xx = " \
@@ -58,7 +59,6 @@ SRC_URI_append_ep93xx = " \
file://arm-crunch-truncsi-disable.patch;patch=1 \
file://arm-crunch-cfcvt64-disable.patch;patch=1 \
file://arm-crunch-cirrus-bugfixes.patch;patch=1 \
- file://gfortran.patch;patch=1 \
"
PACKAGE_ARCH_ep93xx = "${MACHINE_ARCH}"
diff --git a/packages/gcc/gcc_4.2.2.bb b/packages/gcc/gcc_4.2.2.bb
new file mode 100644
index 0000000000..f13f218ab5
--- /dev/null
+++ b/packages/gcc/gcc_4.2.2.bb
@@ -0,0 +1,83 @@
+PR = "r0"
+DESCRIPTION = "The GNU cc and gcc C compilers."
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+
+inherit autotools gettext
+
+require gcc-package.inc
+
+SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+ file://100-uclibc-conf.patch;patch=1 \
+ file://103-uclibc-conf-noupstream.patch;patch=1 \
+ file://200-uclibc-locale.patch;patch=1 \
+ file://203-uclibc-locale-no__x.patch;patch=1 \
+ file://204-uclibc-locale-wchar_fix.patch;patch=1 \
+ file://205-uclibc-locale-update.patch;patch=1 \
+ file://300-libstdc++-pic.patch;patch=1 \
+ file://301-missing-execinfo_h.patch;patch=1 \
+ file://302-c99-snprintf.patch;patch=1 \
+ file://303-c99-complex-ugly-hack.patch;patch=1 \
+ file://304-index_macro.patch;patch=1 \
+ file://305-libmudflap-susv3-legacy.patch;patch=1 \
+ file://306-libstdc++-namespace.patch;patch=1 \
+ file://307-locale_facets.patch;patch=1 \
+ file://402-libbackend_dep_gcov-iov.h.patch;patch=1 \
+ file://602-sdk-libstdc++-includes.patch;patch=1 \
+ file://740-sh-pr24836.patch;patch=1 \
+ file://800-arm-bigendian.patch;patch=1 \
+ file://904-flatten-switch-stmt-00.patch;patch=1 \
+ file://arm-nolibfloat.patch;patch=1 \
+ file://arm-softfloat.patch;patch=1 \
+ file://gcc41-configure.in.patch;patch=1 \
+ file://arm-thumb.patch;patch=1 \
+ file://arm-thumb-cache.patch;patch=1 \
+ file://ldflags.patch;patch=1 \
+ file://zecke-xgcc-cpp.patch;patch=1 \
+ file://unbreak-armv4t.patch;patch=1 \
+ file://fix-ICE-in-arm_unwind_emit_set.diff;patch=1 \
+ file://cache-amnesia.patch;patch=1 \
+ file://gfortran.patch;patch=1 \
+"
+
+SRC_URI_append_ep93xx = " \
+ file://arm-crunch-saveregs.patch;patch=1 \
+ file://arm-crunch-20000320.patch;patch=1 \
+ file://arm-crunch-compare.patch;patch=1 \
+ file://arm-crunch-compare-unordered.patch;patch=1 \
+ file://arm-crunch-compare-geu.patch;patch=1 \
+ file://arm-crunch-eabi-ieee754.patch;patch=1 \
+ file://arm-crunch-eabi-ieee754-div.patch;patch=1 \
+ file://arm-crunch-64bit-disable0.patch;patch=1 \
+ file://arm-crunch-offset.patch;patch=1 \
+ file://arm-crunch-fp_consts.patch;patch=1 \
+ file://arm-crunch-neg2.patch;patch=1 \
+ file://arm-crunch-predicates3.patch;patch=1 \
+ file://arm-crunch-cfcvtds-disable.patch;patch=1 \
+ file://arm-crunch-floatsi-disable.patch;patch=1 \
+ file://arm-crunch-truncsi-disable.patch;patch=1 \
+ file://arm-crunch-cfcvt64-disable.patch;patch=1 \
+ file://arm-crunch-cirrus-bugfixes.patch;patch=1 \
+ "
+
+PACKAGE_ARCH_ep93xx = "${MACHINE_ARCH}"
+
+SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
+
+#Set the fortran bits
+# 'i,fortran' or '', not 'f77' like gcc3 had
+FORTRAN = ""
+FORTRAN_linux-gnueabi = ",fortran"
+
+#Set the java bits
+JAVA = ""
+JAVA_arm = ""
+
+LANGUAGES = "c,c++${FORTRAN}${JAVA}"
+require gcc3-build.inc
+ARCH_FLAGS_FOR_TARGET=-isystem${STAGING_INCDIR}
+
+
+EXTRA_OECONF += " --disable-libssp --disable-bootstrap "
+
diff --git a/packages/glib-2.0/glib-2.0-2.14.0/gcc-4.2-inline-fix.patch b/packages/glib-2.0/glib-2.0-2.14.0/gcc-4.2-inline-fix.patch
new file mode 100644
index 0000000000..ea2b41e900
--- /dev/null
+++ b/packages/glib-2.0/glib-2.0-2.14.0/gcc-4.2-inline-fix.patch
@@ -0,0 +1,17 @@
+Index: glib-2.12.9/glib/gutils.h
+===================================================================
+--- glib-2.12.9.orig/glib/gutils.h 2007-10-07 19:13:53.000000000 +0200
++++ glib-2.12.9/glib/gutils.h 2007-10-07 19:15:04.000000000 +0200
+@@ -97,7 +97,11 @@
+ # define G_INLINE_FUNC
+ # undef G_CAN_INLINE
+ #elif defined (__GNUC__)
+-# define G_INLINE_FUNC extern inline
++# if defined (__GNUC_GNU_INLINE__)
++# define G_INLINE_FUNC extern __attribute__((gnu_inline)) inline
++# else
++# define G_INLINE_FUNC extern inline
++# endif
+ #elif defined (G_CAN_INLINE)
+ # define G_INLINE_FUNC static inline
+ #else /* can't inline */
diff --git a/packages/glib-2.0/glib-2.0-2.14.1/.mtn2git_empty b/packages/glib-2.0/glib-2.0-2.14.1/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/glib-2.0/glib-2.0-2.14.1/.mtn2git_empty
diff --git a/packages/glib-2.0/glib-2.0-2.14.1/configure-libtool.patch b/packages/glib-2.0/glib-2.0-2.14.1/configure-libtool.patch
new file mode 100644
index 0000000000..a52327c8c9
--- /dev/null
+++ b/packages/glib-2.0/glib-2.0-2.14.1/configure-libtool.patch
@@ -0,0 +1,29 @@
+--- glib-2.12.10/configure.in.orig 2006-06-05 13:34:08.000000000 +0100
++++ glib-2.12.10/configure.in 2006-06-05 13:34:36.000000000 +0100
+@@ -1174,7 +1174,7 @@
+ G_MODULE_LDFLAGS=
+ else
+ export SED
+- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++ G_MODULE_LDFLAGS=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1265,7 +1265,7 @@
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ echo "void glib_plugin_test(void) { }" > plugin.c
+- ${SHELL} ./libtool --mode=compile ${CC} -shared \
++ ${SHELL} ./$host_alias-libtool --mode=compile ${CC} -shared \
+ -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null
+ AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
+ glib_cv_rtldglobal_broken,[
+@@ -1339,7 +1339,7 @@
+
+ AC_MSG_CHECKING(for the suffix of shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`./$host_alias-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
diff --git a/packages/glib-2.0/glib-2.0-2.14.1/gcc-4.2-inline-fix.patch b/packages/glib-2.0/glib-2.0-2.14.1/gcc-4.2-inline-fix.patch
new file mode 100644
index 0000000000..ea2b41e900
--- /dev/null
+++ b/packages/glib-2.0/glib-2.0-2.14.1/gcc-4.2-inline-fix.patch
@@ -0,0 +1,17 @@
+Index: glib-2.12.9/glib/gutils.h
+===================================================================
+--- glib-2.12.9.orig/glib/gutils.h 2007-10-07 19:13:53.000000000 +0200
++++ glib-2.12.9/glib/gutils.h 2007-10-07 19:15:04.000000000 +0200
+@@ -97,7 +97,11 @@
+ # define G_INLINE_FUNC
+ # undef G_CAN_INLINE
+ #elif defined (__GNUC__)
+-# define G_INLINE_FUNC extern inline
++# if defined (__GNUC_GNU_INLINE__)
++# define G_INLINE_FUNC extern __attribute__((gnu_inline)) inline
++# else
++# define G_INLINE_FUNC extern inline
++# endif
+ #elif defined (G_CAN_INLINE)
+ # define G_INLINE_FUNC static inline
+ #else /* can't inline */
diff --git a/packages/glib-2.0/glib-2.0_2.14.0.bb b/packages/glib-2.0/glib-2.0_2.14.0.bb
index 995efbd119..e4318cd1f0 100644
--- a/packages/glib-2.0/glib-2.0_2.14.0.bb
+++ b/packages/glib-2.0/glib-2.0_2.14.0.bb
@@ -2,4 +2,5 @@ require glib.inc
SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/glib/2.14/glib-${PV}.tar.bz2 \
file://glibconfig-sysdefs.h \
- file://configure-libtool.patch;patch=1"
+ file://configure-libtool.patch;patch=1 \
+ file://gcc-4.2-inline-fix.patch;patch=1"
diff --git a/packages/glib-2.0/glib-2.0_2.14.1.bb b/packages/glib-2.0/glib-2.0_2.14.1.bb
new file mode 100644
index 0000000000..e4318cd1f0
--- /dev/null
+++ b/packages/glib-2.0/glib-2.0_2.14.1.bb
@@ -0,0 +1,6 @@
+require glib.inc
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/glib/2.14/glib-${PV}.tar.bz2 \
+ file://glibconfig-sysdefs.h \
+ file://configure-libtool.patch;patch=1 \
+ file://gcc-4.2-inline-fix.patch;patch=1"
diff --git a/packages/gnutls/gnutls_1.6.2.bb b/packages/gnutls/gnutls_1.6.2.bb
deleted file mode 100644
index 68077c0c5a..0000000000
--- a/packages/gnutls/gnutls_1.6.2.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require gnutls.inc
-PR = "r1"
-
-do_configure_prepend() {
- sed -i "s/2.60/2.59/" ${S}/configure.in
-}
diff --git a/packages/gnutls/gnutls_1.6.3.bb b/packages/gnutls/gnutls_1.6.3.bb
new file mode 100644
index 0000000000..6e0f6000d3
--- /dev/null
+++ b/packages/gnutls/gnutls_1.6.3.bb
@@ -0,0 +1,2 @@
+require gnutls.inc
+PR = "r2"
diff --git a/packages/gpephone/gpe-session-scripts-phone/phonesession b/packages/gpephone/gpe-session-scripts-phone/phonesession
index 2f573a13fa..524199ee16 100755
--- a/packages/gpephone/gpe-session-scripts-phone/phonesession
+++ b/packages/gpephone/gpe-session-scripts-phone/phonesession
@@ -54,6 +54,7 @@ esdplay /mnt/sd/sounds/startup.wav
# Start SoundServer
soundserver &
+alsactl restore -f /etc/gsmhandset.state
# Run GSM support stuff
diff --git a/packages/gpephone/gpe-session-scripts-phone_0.67.bb b/packages/gpephone/gpe-session-scripts-phone_0.67.bb
index ac867a9c02..62bd5a649b 100644
--- a/packages/gpephone/gpe-session-scripts-phone_0.67.bb
+++ b/packages/gpephone/gpe-session-scripts-phone_0.67.bb
@@ -14,7 +14,7 @@ SRC_URI = "${GPE_MIRROR}/gpe-session-scripts-${PV}.tar.gz \
file://disable-composite.xsettings \
file://standard-apps.patch;patch=1"
-PR = "r9"
+PR = "r10"
S = "${WORKDIR}/gpe-session-scripts-${PV}"
diff --git a/packages/gstreamer/gst-plugins.inc b/packages/gstreamer/gst-plugins.inc
index 24eb54a9b4..48f33ff539 100644
--- a/packages/gstreamer/gst-plugins.inc
+++ b/packages/gstreamer/gst-plugins.inc
@@ -6,7 +6,7 @@ PACKAGES_DYNAMIC = "gst-plugin-*"
SRC_URI = "http://gstreamer.freedesktop.org/src/${PN}/${PN}-${PV}.tar.bz2"
-EXTRA_OECONF = "--disable-aalib --disable-shout2 --disable-sdl --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR} "
+EXTRA_OECONF = "--disable-aalib --disable-shout2 --disable-sdl -disable-cdaudio --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR} "
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
diff --git a/packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb b/packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb
index 6fbc7d936f..2896079e8e 100644
--- a/packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb
+++ b/packages/gtk+/gdk-pixbuf-csource-native_2.10.14.bb
@@ -1,6 +1,6 @@
require gtk+_${PV}.bb
inherit native
-DEPENDS = "jpeg-native libpng-native"
+DEPENDS = "jpeg-native libpng-native gettext-native glib-2.0-native"
S = "${WORKDIR}/gtk+-${PV}"
FILESPATH = "${FILE_DIRNAME}/gdk-pixbuf-csource:${FILE_DIRNAME}/gtk+-${PV}:${FILE_DIRNAME}/files"
SRC_URI += "file://reduce-dependencies.patch;patch=1"
diff --git a/packages/gtk-webcore/osb-jscore_20070816.bb b/packages/gtk-webcore/osb-jscore_20070816.bb
index b5aa879a18..672b0ba0a7 100644
--- a/packages/gtk-webcore/osb-jscore_20070816.bb
+++ b/packages/gtk-webcore/osb-jscore_20070816.bb
@@ -12,7 +12,7 @@ SRC_URI = "cvs://anonymous@gtk-webcore.cvs.sourceforge.net/cvsroot/gtk-webcore;m
file://gcc4-fno-threadsafe-statics-JavaScriptCore.patch;patch=1"
S = "${WORKDIR}/JavaScriptCore"
-DEFAULT_PREFERENCE = "${@['-1', '1'][not bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1) or bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1).split('.')[0] == '4']}"
+DEFAULT_PREFERENCE = "-1"
inherit autotools pkgconfig
diff --git a/packages/gtk-webcore/osb-jscore_svn.bb b/packages/gtk-webcore/osb-jscore_svn.bb
index c75db61a9a..554ab5b96d 100644
--- a/packages/gtk-webcore/osb-jscore_svn.bb
+++ b/packages/gtk-webcore/osb-jscore_svn.bb
@@ -3,9 +3,7 @@ HOMEPAGE = "http://gtk-webcore.sourceforge.net/"
LICENSE = "GPL"
PRIORITY = "optional"
-DEFAULT_PREFERENCE = "-1"
-
-PV = "0.5.2+svnr${SRCDATE}"
+PV = "0.5.2+svnr${SRCREV}"
PR = "r1"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=JavaScriptCore;proto=https \
diff --git a/packages/gtk-webcore/osb-nrcit_20070816.bb b/packages/gtk-webcore/osb-nrcit_20070816.bb
index 3bfec98924..3441d1d508 100644
--- a/packages/gtk-webcore/osb-nrcit_20070816.bb
+++ b/packages/gtk-webcore/osb-nrcit_20070816.bb
@@ -15,7 +15,7 @@ SRC_URI = "cvs://anonymous@gtk-webcore.cvs.sourceforge.net/cvsroot/gtk-webcore;m
file://gcc4-fno-threadsafe-statics-NRCit.patch;patch=1"
S = "${WORKDIR}/NRCit"
-DEFAULT_PREFERENCE = "${@['-1', '1'][not bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1) or bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1).split('.')[0] == '4']}"
+DEFAULT_PREFERENCE = "-1"
inherit autotools pkgconfig
diff --git a/packages/gtk-webcore/osb-nrcit_svn.bb b/packages/gtk-webcore/osb-nrcit_svn.bb
index d982c6b595..7ea8b3b6fa 100644
--- a/packages/gtk-webcore/osb-nrcit_svn.bb
+++ b/packages/gtk-webcore/osb-nrcit_svn.bb
@@ -4,19 +4,18 @@ LICENSE = "nokia"
PRIORITY = "optional"
SECTION = "gpe"
-PV = "0.5.2+svnr${SRCDATE}"
+PV = "0.5.2+svnr${SRCREV}"
PR = "r0"
DEPENDS = "curl librsvg osb-nrcore pango"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCit;proto=https \
file://gcc4-fno-threadsafe-statics-NRCit.patch;patch=1"
-S = "${WORKDIR}/NRCit"
-
-DEFAULT_PREFERENCE = "-1"
inherit autotools pkgconfig
+S = "${WORKDIR}/NRCit"
+
EXTRA_OECONF = " --enable-pango "
do_configure () {
diff --git a/packages/gtk-webcore/osb-nrcore_20070816.bb b/packages/gtk-webcore/osb-nrcore_20070816.bb
index 991af8d24d..1c946d05c6 100644
--- a/packages/gtk-webcore/osb-nrcore_20070816.bb
+++ b/packages/gtk-webcore/osb-nrcore_20070816.bb
@@ -11,4 +11,4 @@ SRC_URI = "cvs://anonymous@gtk-webcore.cvs.sourceforge.net/cvsroot/gtk-webcore;m
S = "${WORKDIR}/NRCore"
-DEFAULT_PREFERENCE = "${@['-1', '1'][not bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1) or bb.data.getVar('PREFERRED_VERSION_gcc-cross', d, 1).split('.')[0] == '4']}"
+DEFAULT_PREFERENCE = "-1"
diff --git a/packages/gtk-webcore/osb-nrcore_svn.bb b/packages/gtk-webcore/osb-nrcore_svn.bb
index 5ca22d3083..8e0b4b04b6 100644
--- a/packages/gtk-webcore/osb-nrcore_svn.bb
+++ b/packages/gtk-webcore/osb-nrcore_svn.bb
@@ -1,8 +1,6 @@
require osb-nrcore.inc
-DEFAULT_PREFERENCE = "-1"
-
-PV = "0.5.2+svnr${SRCDATE}"
+PV = "0.5.2+svnr${SRCREV}"
PR = "r1"
SRC_URI = "svn://gtk-webcore.svn.sourceforge.net/svnroot/gtk-webcore/trunk;module=NRCore;proto=https \
diff --git a/packages/hal/ohm_git.bb b/packages/hal/ohm_git.bb
index cd003b4b72..11fbd1c929 100644
--- a/packages/hal/ohm_git.bb
+++ b/packages/hal/ohm_git.bb
@@ -13,7 +13,11 @@ S = "${WORKDIR}/git"
inherit autotools pkgconfig
-EXTRA_OECONF = "--with-distro=debian"
+EXTRA_OECONF = "--with-distro=debian --without-xauth"
+
+do_configure_prepend() {
+ touch gtk-doc.make
+}
do_configure_append() {
rm config.log
diff --git a/packages/icu/icu-3.6.inc b/packages/icu/icu-3.6.inc
index 92176ee7fb..b9031e202a 100644
--- a/packages/icu/icu-3.6.inc
+++ b/packages/icu/icu-3.6.inc
@@ -5,7 +5,7 @@ SRC_URI = "ftp://ftp.software.ibm.com/software/globalization/icu/3.6/icu4c-3_6-s
S = "${WORKDIR}/icu/source"
-inherit autotools pkgconfig
+inherit autotools pkgconfig binconfig
do_configure() {
libtoolize --force
diff --git a/packages/angstrom/angstrom-altboot-console-image.bb b/packages/images/altboot-console-image.bb
index 32a1564afe..ff5984981a 100644
--- a/packages/angstrom/angstrom-altboot-console-image.bb
+++ b/packages/images/altboot-console-image.bb
@@ -1,4 +1,4 @@
-require angstrom-console-image.bb
+require console-image.bb
ANGSTROM_EXTRA_INSTALL += " altboot "
diff --git a/packages/angstrom/angstrom-altboot-x11-image.bb b/packages/images/altboot-x11-image.bb
index ce3fd820c3..d4b129e48c 100644
--- a/packages/angstrom/angstrom-altboot-x11-image.bb
+++ b/packages/images/altboot-x11-image.bb
@@ -1,4 +1,4 @@
-require angstrom-x11-image.bb
+require x11-image.bb
ANGSTROM_EXTRA_INSTALL += " altboot "
export IMAGE_BASENAME = "altboot-x11-image"
diff --git a/packages/angstrom/angstrom-bootmanager-image.bb b/packages/images/bootmanager-image.bb
index d829590188..d829590188 100644
--- a/packages/angstrom/angstrom-bootmanager-image.bb
+++ b/packages/images/bootmanager-image.bb
diff --git a/packages/angstrom/angstrom-console-image.bb b/packages/images/console-image.bb
index 1684716187..1684716187 100644
--- a/packages/angstrom/angstrom-console-image.bb
+++ b/packages/images/console-image.bb
diff --git a/packages/angstrom/angstrom-gateway-image.bb b/packages/images/gateway-image.bb
index ee9d1d97fc..ee9d1d97fc 100644
--- a/packages/angstrom/angstrom-gateway-image.bb
+++ b/packages/images/gateway-image.bb
diff --git a/packages/images/angstrom-minimal-image-with-mtd-utils.bb b/packages/images/minimal-image-with-mtd-utils.bb
index 4fe33e9282..b778300580 100644
--- a/packages/images/angstrom-minimal-image-with-mtd-utils.bb
+++ b/packages/images/minimal-image-with-mtd-utils.bb
@@ -2,7 +2,7 @@
# for creating a small initramfs image in NOR flash that can be used
# to program the NAND flash.
-require angstrom-minimal-image.bb
+require minimal-image.bb
IMAGE_INSTALL += "mtd-utils"
export IMAGE_BASENAME = "minimalist-image-mtdutils"
diff --git a/packages/images/angstrom-minimal-image.bb b/packages/images/minimal-image.bb
index 4b3a4cd835..4b3a4cd835 100644
--- a/packages/images/angstrom-minimal-image.bb
+++ b/packages/images/minimal-image.bb
diff --git a/packages/angstrom/angstrom-mokogateway-image.bb b/packages/images/mokogateway-image.bb
index a8c59f2075..a8c59f2075 100644
--- a/packages/angstrom/angstrom-mokogateway-image.bb
+++ b/packages/images/mokogateway-image.bb
diff --git a/packages/angstrom/angstrom-x11-gpe-image.bb b/packages/images/x11-gpe-image.bb
index ffd401b6a8..ffd401b6a8 100644
--- a/packages/angstrom/angstrom-x11-gpe-image.bb
+++ b/packages/images/x11-gpe-image.bb
diff --git a/packages/angstrom/angstrom-x11-image.bb b/packages/images/x11-image.bb
index e430590a7f..e430590a7f 100644
--- a/packages/angstrom/angstrom-x11-image.bb
+++ b/packages/images/x11-image.bb
diff --git a/packages/angstrom/angstrom-x11-office-image.bb b/packages/images/x11-office-image.bb
index f9dcb8cf43..f6a8d0af1d 100644
--- a/packages/angstrom/angstrom-x11-office-image.bb
+++ b/packages/images/x11-office-image.bb
@@ -19,7 +19,7 @@ IMAGE_INSTALL = "\
abiword \
gnumeric \
cups \
- claws-mail claws-mail claws-plugin-maildir claws-plugin-mailmbox claws-plugin-rssyl \
+ claws-mail claws-mail claws-plugin-mailmbox claws-plugin-rssyl \
midori minimo \
gphoto2 \
${ANGSTROM_EXTRA_INSTALL}"
diff --git a/packages/angstrom/angstrom-x11-pimlico-image.bb b/packages/images/x11-pimlico-image.bb
index c7acedfa0d..c7acedfa0d 100644
--- a/packages/angstrom/angstrom-x11-pimlico-image.bb
+++ b/packages/images/x11-pimlico-image.bb
diff --git a/packages/libtiff/tiff-3.7.2/.mtn2git_empty b/packages/libtiff/tiff-3.7.2/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/libtiff/tiff-3.7.2/.mtn2git_empty
diff --git a/packages/libtiff/tiff-3.7.2/configure.patch b/packages/libtiff/tiff-3.7.2/configure.patch
new file mode 100644
index 0000000000..599af6c188
--- /dev/null
+++ b/packages/libtiff/tiff-3.7.2/configure.patch
@@ -0,0 +1,20 @@
+Index: tiff-3.7.2/configure.ac
+===================================================================
+--- tiff-3.7.2.orig/configure.ac 2005-03-15 10:42:19.000000000 -0500
++++ tiff-3.7.2/configure.ac 2007-10-10 12:05:58.000000000 -0400
+@@ -32,7 +32,6 @@
+ AC_CANONICAL_TARGET
+
+ AM_INIT_AUTOMAKE
+-AM_PROG_CC_C_O
+ dnl Do not rebuild generated files every time
+ AM_MAINTAINER_MODE
+
+@@ -55,6 +54,7 @@
+
+ dnl Checks for programs.
+ AC_PROG_CC
++AM_PROG_CC_C_O
+
+ dnl We want warnings. As many warnings as possible.
+ #VL_PROG_CC_WARNINGS()
diff --git a/packages/libtiff/tiff_3.7.2.bb b/packages/libtiff/tiff_3.7.2.bb
index d98974541d..671de80db9 100644
--- a/packages/libtiff/tiff_3.7.2.bb
+++ b/packages/libtiff/tiff_3.7.2.bb
@@ -2,9 +2,10 @@ DESCRIPTION = "This software provides support for the Tag Image File Format (TIF
LICENSE = ""
HOMEPAGE = "http://www.remotesensing.org/libtiff/"
DEPENDS = "zlib jpeg"
-PR = "r2"
+PR = "r3"
-SRC_URI = "http://dl.maptools.org/dl/libtiff/old/tiff-${PV}.tar.gz"
+SRC_URI = "http://dl.maptools.org/dl/libtiff/old/tiff-${PV}.tar.gz \
+ file://configure.patch;patch=1"
inherit autotools
diff --git a/packages/libw100/libw100_svn.bb b/packages/libw100/libw100_svn.bb
index f8d5544625..4f33c625ca 100644
--- a/packages/libw100/libw100_svn.bb
+++ b/packages/libw100/libw100_svn.bb
@@ -1,11 +1,9 @@
DESCRIPTION = "Acceleration library for ATI imageon chipsets (w100 and w3220)"
LICENSE = "GPLv2"
-PV = "0.0.2+svn${SRCDATE}"
+PV = "0.0.2+svn${SRCREV}"
SRC_URI = "svn://libw100.svn.sourceforge.net/svnroot/libw100;module=trunk;proto=https"
-DEFAULT_PREFERENCE = "-1"
-
S = "${WORKDIR}/trunk"
inherit autotools pkgconfig
diff --git a/packages/linux/compulab-pxa270_2.6.22.bb b/packages/linux/compulab-pxa270_2.6.22.bb
deleted file mode 100644
index 84c1c63367..0000000000
--- a/packages/linux/compulab-pxa270_2.6.22.bb
+++ /dev/null
@@ -1,67 +0,0 @@
-require linux.inc
-
-SECTION = "kernel"
-DESCRIPTION = "Linux kernel for the Compulab PXA270 system"
-LICENSE = "GPL"
-PR = "r1"
-
-SRC_URI = "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
- file://0001-cm-x270-base2.patch;patch=1 \
- file://0002-cm-x270-match-type.patch;patch=1 \
- file://0003-cm-x270-ide.patch;patch=1 \
- file://0004-cm-x270-it8152.patch;patch=1 \
- file://0005-cm-x270-pcmcia.patch;patch=1 \
- file://0006-ramdisk_load.patch;patch=1 \
- file://0007-mmcsd_large_cards-r0.patch;patch=1 \
- file://0008-cm-x270-nand-simplify-name.patch;patch=1 \
- file://defconfig \
- "
-
-# file://0009-cursor-fix.patch
-
-
-
-# Note, for 2.6.22, we are no longer using the compulab binary
-# flash driver -- use JFFS2 instead
-# see notes in conf/machine/compulab-pxa270.conf
-
-S = "${WORKDIR}/linux-${PV}"
-
-COMPATIBLE_HOST = 'arm.*-linux'
-COMPATIBLE_MACHINE = "cm-x270"
-
-CMDLINE = "console=${CMX270_CONSOLE_SERIAL_PORT},38400 monitor=8 bpp=16 mem=64M mtdparts=physmap-flash.0:256k(boot)ro,0x180000(kernel),-(root);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd3 rootfstype=jffs2"
-
-inherit kernel
-inherit package
-
-ARCH = "arm"
-
-FILES_kernel-image = ""
-
-python do_compulab_image() {
- import os
- import os.path
- import struct
-
- deploy_dir = bb.data.getVar('DEPLOY_DIR_IMAGE', d, 1)
- kernel_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.bin')
- img_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.cmx270')
-
- fo = open(img_file, 'wb')
-
- image_data = open(kernel_file, 'rb').read()
-
- # first write size into first 4 bytes
- size_s = struct.pack('i', len(image_data))
-
- # truncate size if we are running on a 64-bit host
- size_s = size_s[:4]
-
- fo.write(size_s)
- fo.write(image_data)
- fo.close()
-}
-
-addtask compulab_image after do_deploy before do_package
-
diff --git a/packages/linux/linux-2.6.21/gumstix-verdex/defconfig b/packages/linux/linux-2.6.21/gumstix-verdex/defconfig
index c6d5480089..3057d62d5e 100644
--- a/packages/linux/linux-2.6.21/gumstix-verdex/defconfig
+++ b/packages/linux/linux-2.6.21/gumstix-verdex/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.21
-# Wed Oct 3 16:35:16 2007
+# Mon Oct 8 11:22:41 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -219,7 +219,7 @@ CONFIG_ALIGNMENT_HANDLING=0x2
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="console=ttyS0,115200n8 root=1f01 rootfstype=jffs2"
+CONFIG_CMDLINE=""
# CONFIG_XIP_KERNEL is not set
CONFIG_KEXEC=y
@@ -1058,6 +1058,8 @@ CONFIG_I2C_PXA_SLAVE=y
# CONFIG_SENSORS_PCA9539 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_MAX6875 is not set
+CONFIG_SENSORS_TSC2003=m
+CONFIG_SENSORS_TSC2003_SYSFS=m
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
@@ -1138,6 +1140,9 @@ CONFIG_FB_PXA=y
# CONFIG_FB_PXA_SHARP_LQ043_PSP is not set
CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C=y
# CONFIG_FB_PXA_NONEOFTHEABOVE is not set
+# CONFIG_FB_PXA_LCD_QVGA is not set
+CONFIG_FB_PXA_LCD_VGA=y
+CONFIG_FB_PXA_OVERLAY=y
CONFIG_FB_PXA_PARAMETERS=y
# CONFIG_FB_MBX is not set
# CONFIG_FB_VIRTUAL is not set
diff --git a/packages/linux/linux-2.6.21/tsc2003-config.diff b/packages/linux/linux-2.6.21/tsc2003-config.diff
new file mode 100644
index 0000000000..ccad5ed696
--- /dev/null
+++ b/packages/linux/linux-2.6.21/tsc2003-config.diff
@@ -0,0 +1,31 @@
+--- /tmp/Kconfig 2007-10-07 14:13:14.000000000 +0200
++++ linux-2.6.21/drivers/i2c/chips/Kconfig 2007-10-07 14:13:56.902045000 +0200
+@@ -125,4 +125,18 @@
+ This driver can also be built as a module. If so, the module
+ will be called max6875.
+
++config SENSORS_TSC2003
++ tristate "TI TSC2003"
++ depends on I2C && EXPERIMENTAL
++ default n
++ help
++ Driver for TI tsc2003 touchscreen and sensor chip/
++
++config SENSORS_TSC2003_SYSFS
++ tristate "TI TSC2003 sysfs interface
++ depends on SENSORS_TSC2003
++ default n
++ help
++ Enabled the sysfs interface for tsc2003
++
+ endmenu
+--- /tmp/Makefile 2007-10-07 14:14:14.000000000 +0200
++++ linux-2.6.21/drivers/i2c/chips/Makefile 2007-10-07 14:14:20.072045000 +0200
+@@ -12,6 +12,7 @@
+ obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
+ obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
+ obj-$(CONFIG_TPS65010) += tps65010.o
++obj-$(CONFIG_SENSORS_TSC2003) += tsc2003.o
+
+ ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
+ EXTRA_CFLAGS += -DDEBUG
diff --git a/packages/linux/linux-2.6.21/tsc2003.c b/packages/linux/linux-2.6.21/tsc2003.c
new file mode 100644
index 0000000000..8d7e5b3f78
--- /dev/null
+++ b/packages/linux/linux-2.6.21/tsc2003.c
@@ -0,0 +1,557 @@
+/*
+ * linux/drivers/i2c/chips/tsc2003.c
+ *
+ * Copyright (C) 2005 Bill Gatliff <bgat at billgatliff.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Driver for TI's TSC2003 I2C Touch Screen Controller
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/string.h>
+#include <linux/bcd.h>
+#include <linux/list.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/input.h>
+#include <linux/platform_device.h>
+#include <asm/delay.h>
+#include <linux/delay.h>
+
+#include <asm/arch/gpio.h>
+
+#define DRIVER_NAME "tsc2003"
+
+enum tsc2003_pd {
+ PD_POWERDOWN = 0, /* penirq */
+ PD_IREFOFF_ADCON = 1, /* no penirq */
+ PD_IREFON_ADCOFF = 2, /* penirq */
+ PD_IREFON_ADCON = 3, /* no penirq */
+ PD_PENIRQ_ARM = PD_IREFON_ADCOFF,
+ PD_PENIRQ_DISARM = PD_IREFON_ADCON,
+};
+
+enum tsc2003_m {
+ M_12BIT = 0,
+ M_8BIT = 1
+};
+
+enum tsc2003_cmd {
+ MEAS_TEMP0 = 0,
+ MEAS_VBAT1 = 1,
+ MEAS_IN1 = 2,
+ MEAS_TEMP1 = 4,
+ MEAS_VBAT2 = 5,
+ MEAS_IN2 = 6,
+ ACTIVATE_NX_DRIVERS = 8,
+ ACTIVATE_NY_DRIVERS = 9,
+ ACTIVATE_YNX_DRIVERS = 10,
+ MEAS_XPOS = 12,
+ MEAS_YPOS = 13,
+ MEAS_Z1POS = 14,
+ MEAS_Z2POS = 15
+};
+
+#define TSC2003_CMD(cn,pdn,m) (((cn) << 4) | ((pdn) << 2) | ((m) << 1))
+
+#define ADC_MAX ((1 << 12) - 1)
+
+struct tsc2003_data {
+ struct i2c_client *client;
+ struct input_dev *idev;
+ struct timer_list penirq_timer;
+ struct semaphore sem;
+ struct task_struct *tstask;
+ struct completion tstask_completion;
+ enum tsc2003_pd pd;
+ enum tsc2003_m m;
+ int vbat1;
+ int vbat2;
+ int temp0;
+ int temp1;
+ int in1;
+ int in2;
+};
+
+static int tsc2003_i2c_detect (struct i2c_adapter *adapter, int address,
+ int kind);
+
+static inline int tsc2003_command (struct tsc2003_data *data,
+ enum tsc2003_cmd cmd,
+ enum tsc2003_pd pd)
+{
+ char c;
+ int ret;
+ down(&data->sem);
+ c = TSC2003_CMD(cmd, pd, data->m);
+ ret = i2c_master_send(data->client, &c, 1);
+ up(&data->sem);
+ return ret;
+}
+
+static int tsc2003_read (struct tsc2003_data *data,
+ enum tsc2003_cmd cmd,
+ enum tsc2003_pd pd,
+ int *val)
+{
+ char c;
+ char d[2];
+ int ret;
+
+ c = TSC2003_CMD(cmd, pd, data->m);
+ ret = i2c_master_send(data->client, &c, 1);
+
+ udelay(20);
+ ret = i2c_master_recv(data->client, d, data->m == M_12BIT ? 2 : 1);
+
+ if (val)
+ {
+ *val = d[0];
+ *val <<= 4;
+ if (data->m == M_12BIT)
+ *val += (d[1] >> 4);
+ }
+
+#if defined(CONFIG_I2C_DEBUG_CHIP)
+ printk(KERN_ERR "%s: val[%x] = %d\n",
+ __FUNCTION__, cmd, (((int)d[0]) << 8) + d[1]);
+#endif
+
+ return 0;
+ if (!ret) ret = -ENODEV;
+ return ret;
+}
+
+static inline int tsc2003_read_temp0 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_TEMP0, pd, t);
+}
+
+static inline int tsc2003_read_temp1 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_TEMP1, pd, t);
+}
+
+static inline int tsc2003_read_xpos (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *x)
+{
+ return tsc2003_read(d, MEAS_XPOS, pd, x);
+}
+
+static inline int tsc2003_read_ypos (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *y)
+{
+ return tsc2003_read(d, MEAS_YPOS, pd, y);
+}
+
+static inline int tsc2003_read_pressure (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *p)
+{
+ return tsc2003_read(d, MEAS_Z1POS, pd, p);
+}
+
+static inline int tsc2003_read_in1 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_IN1, pd, t);
+}
+
+static inline int tsc2003_read_in2 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_IN2, pd, t);
+}
+
+static inline int tsc2003_read_vbat1 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_VBAT1, pd, t);
+}
+
+static inline int tsc2003_read_vbat2 (struct tsc2003_data *d, enum
+ tsc2003_pd pd, int *t)
+{
+ return tsc2003_read(d, MEAS_VBAT2, pd, t);
+}
+
+static inline int tsc2003_powerdown (struct tsc2003_data *d)
+{
+ /* we don't have a distinct powerdown command,
+ so do a benign read with the PD bits cleared */
+ return tsc2003_read(d, MEAS_IN1, PD_POWERDOWN, 0);
+}
+
+void tsc2003_init_client (struct i2c_client *client)
+{
+ struct tsc2003_data *data = i2c_get_clientdata(client);
+
+ data->pd = PD_PENIRQ_DISARM;
+ data->m = M_8BIT;
+ return;
+}
+
+static int tsc2003ts_thread (void *v)
+{
+ struct tsc2003_data *d = v;
+ struct task_struct *tsk = current;
+ int pendown=0;
+
+ d->tstask = tsk;
+
+ daemonize(DRIVER_NAME "tsd");
+ allow_signal(SIGKILL);
+
+ complete(&d->tstask_completion);
+
+ printk(KERN_INFO "%s: address 0x%x\n",
+ __FUNCTION__, d->client->addr);
+
+ while (!signal_pending(tsk))
+ {
+ unsigned int x, y, p;
+
+ tsc2003_read_xpos(d, PD_PENIRQ_DISARM, &x);
+ tsc2003_read_ypos(d, PD_PENIRQ_DISARM, &y);
+ tsc2003_read_pressure(d, PD_PENIRQ_DISARM, &p);
+
+ /* non-X-Y driver read to avoid glitch in penirq (errata?) */
+ if (p > 100) {
+ pendown = 1;
+ input_report_abs(d->idev, ABS_X, x);
+ input_report_abs(d->idev, ABS_Y, y);
+ input_report_abs(d->idev, ABS_PRESSURE, p);
+ input_report_key(d->idev, BTN_TOUCH, 1);
+ input_sync(d->idev);
+ } else if (pendown == 1) {
+ pendown = 0;
+ input_report_key(d->idev, BTN_TOUCH, 0);
+ input_report_abs(d->idev, ABS_PRESSURE, 0);
+ input_sync(d->idev);
+ }
+ schedule_timeout_interruptible(msecs_to_jiffies(10));
+ }
+
+ d->tstask = NULL;
+ complete_and_exit(&d->tstask_completion, 0);
+}
+
+static int tsc2003_idev_open (struct input_dev *idev)
+{
+ struct tsc2003_data *d = idev->private;
+ int ret = 0;
+
+ if (down_interruptible(&d->sem))
+ return -EINTR;
+
+ if (d->tstask)
+ panic(DRIVER_NAME "tsd already running (!). abort.");
+
+ init_completion(&d->tstask_completion);
+
+ ret = kernel_thread(tsc2003ts_thread, d, CLONE_KERNEL);
+ if (ret >= 0) {
+ wait_for_completion(&d->tstask_completion);
+ ret = 0;
+ }
+
+ up(&d->sem);
+
+ return ret;
+}
+
+static void tsc2003_idev_close (struct input_dev *idev)
+{
+ struct tsc2003_data *d = idev->private;
+ down_interruptible(&d->sem);
+ if (d->tstask)
+ {
+ send_sig(SIGKILL, d->tstask, 1);
+ wait_for_completion(&d->tstask_completion);
+ }
+ up(&d->sem);
+ return;
+}
+
+#if defined(CONFIG_SYSFS) && defined(CONFIG_SENSORS_TSC2003_SYSFS)
+static ssize_t show_addr (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->client.addr);
+}
+static DEVICE_ATTR(addr, S_IRUGO, show_addr, NULL);
+
+static ssize_t show_vbat1 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->vbat1);
+}
+static DEVICE_ATTR(vbat1, S_IRUGO, show_vbat1, NULL);
+
+static ssize_t show_vbat2 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->vbat2);
+}
+static DEVICE_ATTR(vbat2, S_IRUGO, show_vbat2, NULL);
+
+static ssize_t show_in1 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->in1);
+}
+static DEVICE_ATTR(in1, S_IRUGO, show_in1, NULL);
+
+static ssize_t show_in2 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->in2);
+}
+static DEVICE_ATTR(in2, S_IRUGO, show_in2, NULL);
+
+static ssize_t show_temp0 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->temp0);
+}
+static DEVICE_ATTR(temp0, S_IRUGO, show_temp0, NULL);
+
+static ssize_t show_temp1 (struct device *dev, char *buf)
+{
+ struct tsc2003_data *d = container_of(dev->driver, struct
+ tsc2003_data, driver);
+ return sprintf(buf, "%d\n", d->temp1);
+}
+static DEVICE_ATTR(temp1, S_IRUGO, show_temp1, NULL);
+
+#warning "TODO: this daemon sometimes hangs the touchscreen daemon"
+#warning "TODO: under periods of heavy touch screen activity."
+#warning "TODO: Use with caution until the bug is squashed."
+static int tsc2003s_thread (void *v)
+{
+ struct tsc2003_data *d = v;
+
+ daemonize(DRIVER_NAME "sd");
+ allow_signal(SIGKILL);
+
+ printk(KERN_INFO "%s: address 0x%x\n",
+ __FUNCTION__, d->client.addr);
+
+ while (!signal_pending(current))
+ {
+ if (!down_interruptible(&d->sem))
+ {
+ if (!timer_pending(&d->penirq_timer))
+ {
+ tsc2003_read_vbat1(d, d->pd, &d->vbat1);
+ tsc2003_read_vbat2(d, d->pd, &d->vbat2);
+ tsc2003_read_in1(d, d->pd, &d->in1);
+ tsc2003_read_in2(d, d->pd, &d->in2);
+ tsc2003_read_temp0(d, d->pd, &d->temp0);
+ tsc2003_read_temp1(d, d->pd, &d->temp1);
+ }
+ up(&d->sem);
+ }
+ set_task_state(current, TASK_INTERRUPTIBLE);
+ schedule_timeout(5 * HZ);
+ }
+ do_exit(0);
+}
+#endif
+
+static int tsc2003_driver_register (struct tsc2003_data *data)
+{
+ int ret = 0;
+
+ init_MUTEX(&data->sem);
+
+ data->idev = input_allocate_device();
+ if(!data->idev)
+ {
+ return -ENOMEM;
+ }
+ data->idev->private = data;
+ data->idev->name = DRIVER_NAME;
+ data->idev->evbit[0] = BIT(EV_ABS);
+ data->idev->open = tsc2003_idev_open;
+ data->idev->close = tsc2003_idev_close;
+ data->idev->absbit[LONG(ABS_X)] = BIT(ABS_X);
+ data->idev->absbit[LONG(ABS_Y)] = BIT(ABS_Y);
+ data->idev->absbit[LONG(ABS_PRESSURE)] = BIT(ABS_PRESSURE);
+ input_set_abs_params(data->idev, ABS_X, 0, ADC_MAX, 0, 0);
+ input_set_abs_params(data->idev, ABS_Y, 0, ADC_MAX, 0, 0);
+
+ ret = input_register_device(data->idev);
+ if(ret)
+ {
+ input_free_device(data->idev);
+ return ret;
+ }
+ return ret;
+}
+
+/* Magic definition of all other variables and things */
+static unsigned short normal_i2c[] = {0x48, 0x49, 0x4a, 0x48b, I2C_CLIENT_END };
+
+I2C_CLIENT_INSMOD;
+
+static int tsc2003_i2c_attach_adapter(struct i2c_adapter *adapter)
+{
+ return i2c_probe(adapter, &addr_data, tsc2003_i2c_detect);
+}
+
+static int tsc2003_i2c_detach_client(struct i2c_client *client)
+{
+ struct tsc2003_data *data=i2c_get_clientdata(client);
+ int err;
+
+ input_unregister_device(data->idev);
+
+ err = i2c_detach_client(client);
+ if (err) {
+ dev_err(&client->dev, "Client deregistration failed, "
+ "client not detached.\n");
+ return err;
+ }
+
+ return 0;
+}
+
+static struct i2c_driver tsc2003_i2c_driver = {
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = DRIVER_NAME,
+ },
+ .attach_adapter = tsc2003_i2c_attach_adapter,
+ .detach_client = tsc2003_i2c_detach_client,
+ .command = NULL
+};
+
+static struct i2c_client client_template = {
+ .name = "TSC2003",
+ .driver = &tsc2003_i2c_driver,
+};
+
+static int tsc2003_i2c_detect (struct i2c_adapter *adap, int addr,
+ int kind)
+{
+ struct i2c_client *i2c;
+ int ret;
+ struct tsc2003_data *data;
+
+ client_template.adapter = adap;
+ client_template.addr = addr;
+
+ printk(KERN_INFO "tsc2003 i2c touch screen controller\n");
+ printk(KERN_INFO "Bill Gatliff <bgat at billgatliff.com>\n");
+
+ i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
+ if (i2c == NULL){
+ return -ENOMEM;
+ }
+
+ data = kcalloc(1, sizeof(*data), GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto err;
+ }
+ data->client = i2c;
+ i2c_set_clientdata(i2c, data);
+
+ ret = i2c_attach_client(i2c);
+
+ if (ret < 0) {
+ printk("failed to attach codec at addr %x\n", addr);
+ goto err;
+ }
+
+ tsc2003_init_client(i2c);
+
+ tsc2003_powerdown(data);
+
+ ret = tsc2003_driver_register(data);
+ if(ret < 0) {
+ printk("driver_register failed\n");
+ goto err;
+ }
+
+ return ret;
+
+err:
+ kfree(i2c);
+ return ret;
+}
+
+#define tsc2003_suspend NULL
+#define tsc2003_resume NULL
+
+static int __devinit tsc2003_probe(struct platform_device *dev)
+{
+ int ret;
+
+ ret=i2c_add_driver(&tsc2003_i2c_driver);
+ if(ret)
+ return ret;
+
+#if defined(CONFIG_SYSFS) && defined(CONFIG_SENSORS_TSC2003_SYSFS)
+ ret = kernel_thread(tsc2003s_thread, d, CLONE_KERNEL);
+ if (ret >= 0)
+ ret = 0;
+
+ device_create_file(dev, &dev_attr_addr);
+ device_create_file(dev, &dev_attr_vbat1);
+ device_create_file(dev, &dev_attr_vbat2);
+ device_create_file(dev, &dev_attr_in1);
+ device_create_file(dev, &dev_attr_in2);
+ device_create_file(dev, &dev_attr_temp0);
+ device_create_file(dev, &dev_attr_temp1);
+#endif
+ return 0;
+}
+
+static int __devexit tsc2003_remove(struct platform_device *dev)
+{
+ i2c_del_driver(&tsc2003_i2c_driver);
+ return 0;
+}
+
+static struct platform_driver tsc2003_driver = {
+ .probe = tsc2003_probe,
+ .remove = __devexit_p(tsc2003_remove),
+ .suspend = tsc2003_suspend,
+ .resume = tsc2003_resume,
+ .driver = {
+ .name = "tsc2003",
+ },
+};
+
+static int __init tsc2003_init(void)
+{
+ return platform_driver_register(&tsc2003_driver);
+}
+
+static void __exit tsc2003_exit(void)
+{
+ platform_driver_unregister(&tsc2003_driver);
+}
+
+MODULE_AUTHOR("Bill Gatliff <bgat at billgatliff.com>");
+MODULE_DESCRIPTION("TSC2003 Touch Screen Controller driver");
+MODULE_LICENSE("GPL");
+
+module_init(tsc2003_init);
+module_exit(tsc2003_exit);
diff --git a/packages/linux/linux-2.6.22/.mtn2git_empty b/packages/linux/linux-2.6.22/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-2.6.22/.mtn2git_empty
diff --git a/packages/linux/linux-2.6.22/cm-x270/.mtn2git_empty b/packages/linux/linux-2.6.22/cm-x270/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-2.6.22/cm-x270/.mtn2git_empty
diff --git a/packages/linux/compulab-pxa270-2.6.22/0001-cm-x270-base2.patch b/packages/linux/linux-2.6.22/cm-x270/0001-cm-x270-base2.patch
index 9a635c5cbc..9a635c5cbc 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0001-cm-x270-base2.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0001-cm-x270-base2.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0002-cm-x270-match-type.patch b/packages/linux/linux-2.6.22/cm-x270/0002-cm-x270-match-type.patch
index 68da30191c..68da30191c 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0002-cm-x270-match-type.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0002-cm-x270-match-type.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0003-cm-x270-ide.patch b/packages/linux/linux-2.6.22/cm-x270/0003-cm-x270-ide.patch
index 0ff115efc8..0ff115efc8 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0003-cm-x270-ide.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0003-cm-x270-ide.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0004-cm-x270-it8152.patch b/packages/linux/linux-2.6.22/cm-x270/0004-cm-x270-it8152.patch
index 274eaf24d8..274eaf24d8 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0004-cm-x270-it8152.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0004-cm-x270-it8152.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0005-cm-x270-pcmcia.patch b/packages/linux/linux-2.6.22/cm-x270/0005-cm-x270-pcmcia.patch
index 7dceff5c9d..7dceff5c9d 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0005-cm-x270-pcmcia.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0005-cm-x270-pcmcia.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0006-ramdisk_load.patch b/packages/linux/linux-2.6.22/cm-x270/0006-ramdisk_load.patch
index aa25dd9bfc..aa25dd9bfc 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0006-ramdisk_load.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0006-ramdisk_load.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0007-mmcsd_large_cards-r0.patch b/packages/linux/linux-2.6.22/cm-x270/0007-mmcsd_large_cards-r0.patch
index 90e66b5308..90e66b5308 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0007-mmcsd_large_cards-r0.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0007-mmcsd_large_cards-r0.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0008-cm-x270-nand-simplify-name.patch b/packages/linux/linux-2.6.22/cm-x270/0008-cm-x270-nand-simplify-name.patch
index c07f049e56..c07f049e56 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0008-cm-x270-nand-simplify-name.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0008-cm-x270-nand-simplify-name.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/0009-cursor-fix.patch b/packages/linux/linux-2.6.22/cm-x270/0009-cursor-fix.patch
index 08b0db36b0..08b0db36b0 100644
--- a/packages/linux/compulab-pxa270-2.6.22/0009-cursor-fix.patch
+++ b/packages/linux/linux-2.6.22/cm-x270/0009-cursor-fix.patch
diff --git a/packages/linux/compulab-pxa270-2.6.22/defconfig b/packages/linux/linux-2.6.22/cm-x270/defconfig
index 63bc69533f..63bc69533f 100644
--- a/packages/linux/compulab-pxa270-2.6.22/defconfig
+++ b/packages/linux/linux-2.6.22/cm-x270/defconfig
diff --git a/packages/linux/linux-2.6.23/.mtn2git_empty b/packages/linux/linux-2.6.23/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-2.6.23/.mtn2git_empty
diff --git a/packages/linux/linux-2.6.23/binutils-buildid-arm.patch b/packages/linux/linux-2.6.23/binutils-buildid-arm.patch
new file mode 100644
index 0000000000..68e35e89e1
--- /dev/null
+++ b/packages/linux/linux-2.6.23/binutils-buildid-arm.patch
@@ -0,0 +1,16 @@
+---
+ arch/arm/kernel/vmlinux.lds.S | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: linux-2.6.22/arch/arm/kernel/vmlinux.lds.S
+===================================================================
+--- linux-2.6.22.orig/arch/arm/kernel/vmlinux.lds.S 2007-09-11 18:32:29.000000000 +0200
++++ linux-2.6.22/arch/arm/kernel/vmlinux.lds.S 2007-09-11 18:33:42.000000000 +0200
+@@ -94,6 +94,7 @@
+ TEXT_TEXT
+ SCHED_TEXT
+ LOCK_TEXT
++ *(.note.*)
+ #ifdef CONFIG_MMU
+ *(.fixup)
+ #endif
diff --git a/packages/linux/linux-2.6.23/cm-x270/.mtn2git_empty b/packages/linux/linux-2.6.23/cm-x270/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/.mtn2git_empty
diff --git a/packages/linux/linux-2.6.23/cm-x270/0001-cm-x270-base2.patch b/packages/linux/linux-2.6.23/cm-x270/0001-cm-x270-base2.patch
new file mode 100644
index 0000000000..dc68ce9d43
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0001-cm-x270-base2.patch
@@ -0,0 +1,2851 @@
+From 299199b0cf17d0247a58af6ccd6cf6b859c60e9a Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 18:55:59 -0400
+Subject: [PATCH] cm-x270-base2
+
+---
+ arch/arm/Kconfig | 8 +-
+ arch/arm/configs/cm_x270_defconfig | 1567 +++++++++++++++++++++++++++++++++++
+ arch/arm/mach-pxa/Kconfig | 6 +
+ arch/arm/mach-pxa/Makefile | 7 +
+ arch/arm/mach-pxa/cm-x270.c | 821 ++++++++++++++++++
+ drivers/leds/Kconfig | 6 +
+ drivers/leds/Makefile | 1 +
+ drivers/leds/leds-cm-x270.c | 126 +++
+ drivers/net/Kconfig | 8 +
+ drivers/net/dm9000.c | 6 +
+ include/asm-arm/arch-pxa/cm-x270.h | 71 ++
+ include/asm-arm/arch-pxa/hardware.h | 11 +
+ include/asm-arm/arch-pxa/irqs.h | 20 +
+ include/asm-arm/memory.h | 10 +
+ 14 files changed, 2667 insertions(+), 1 deletions(-)
+ create mode 100644 arch/arm/configs/cm_x270_defconfig
+ create mode 100644 arch/arm/mach-pxa/cm-x270.c
+ create mode 100644 drivers/leds/leds-cm-x270.c
+ create mode 100644 include/asm-arm/arch-pxa/cm-x270.h
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 691aae3..b9a2b11 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -534,7 +534,7 @@ config ISA_DMA_API
+ bool
+
+ config PCI
+- bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695
++ bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE
+ help
+ Find out whether you have a PCI motherboard. PCI is the name of a
+ bus system, i.e. the way the CPU talks to the other stuff inside
+@@ -555,6 +555,12 @@ config PCI_HOST_VIA82C505
+ depends on PCI && ARCH_SHARK
+ default y
+
++config PCI_HOST_ITE8152
++ bool
++ depends on PCI && MACH_ARMCORE
++ default y
++ select DMABOUNCE
++
+ source "drivers/pci/Kconfig"
+
+ source "drivers/pcmcia/Kconfig"
+diff --git a/arch/arm/configs/cm_x270_defconfig b/arch/arm/configs/cm_x270_defconfig
+new file mode 100644
+index 0000000..f728363
+--- /dev/null
++++ b/arch/arm/configs/cm_x270_defconfig
+@@ -0,0 +1,1567 @@
++#
++# Automatically generated make config: don't edit
++# Linux kernel version: 2.6.21-rc4
++# Wed Apr 4 16:42:03 2007
++#
++CONFIG_ARM=y
++CONFIG_SYS_SUPPORTS_APM_EMULATION=y
++CONFIG_GENERIC_GPIO=y
++CONFIG_GENERIC_TIME=y
++CONFIG_MMU=y
++# CONFIG_NO_IOPORT is not set
++CONFIG_GENERIC_HARDIRQS=y
++CONFIG_TRACE_IRQFLAGS_SUPPORT=y
++CONFIG_HARDIRQS_SW_RESEND=y
++CONFIG_GENERIC_IRQ_PROBE=y
++CONFIG_RWSEM_GENERIC_SPINLOCK=y
++# CONFIG_ARCH_HAS_ILOG2_U32 is not set
++# CONFIG_ARCH_HAS_ILOG2_U64 is not set
++CONFIG_GENERIC_HWEIGHT=y
++CONFIG_GENERIC_CALIBRATE_DELAY=y
++CONFIG_ZONE_DMA=y
++CONFIG_ARCH_MTD_XIP=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++
++#
++# Code maturity level options
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++
++#
++# General setup
++#
++CONFIG_LOCALVERSION=""
++# CONFIG_LOCALVERSION_AUTO is not set
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++# CONFIG_IPC_NS is not set
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++# CONFIG_BSD_PROCESS_ACCT is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_UTS_NS is not set
++# CONFIG_AUDIT is not set
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
++CONFIG_SYSFS_DEPRECATED=y
++# CONFIG_RELAY is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_CC_OPTIMIZE_FOR_SIZE=y
++CONFIG_SYSCTL=y
++CONFIG_EMBEDDED=y
++CONFIG_UID16=y
++CONFIG_SYSCTL_SYSCALL=y
++CONFIG_KALLSYMS=y
++# CONFIG_KALLSYMS_ALL is not set
++# CONFIG_KALLSYMS_EXTRA_PASS is not set
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SHMEM=y
++CONFIG_SLAB=y
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_RT_MUTEXES=y
++# CONFIG_TINY_SHMEM is not set
++CONFIG_BASE_SMALL=0
++# CONFIG_SLOB is not set
++
++#
++# Loadable module support
++#
++CONFIG_MODULES=y
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_KMOD=y
++
++#
++# Block layer
++#
++CONFIG_BLOCK=y
++# CONFIG_LBD is not set
++# CONFIG_BLK_DEV_IO_TRACE is not set
++# CONFIG_LSF is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++CONFIG_IOSCHED_AS=y
++CONFIG_IOSCHED_DEADLINE=y
++CONFIG_IOSCHED_CFQ=y
++CONFIG_DEFAULT_AS=y
++# CONFIG_DEFAULT_DEADLINE is not set
++# CONFIG_DEFAULT_CFQ is not set
++# CONFIG_DEFAULT_NOOP is not set
++CONFIG_DEFAULT_IOSCHED="anticipatory"
++
++#
++# System Type
++#
++# CONFIG_ARCH_AAEC2000 is not set
++# CONFIG_ARCH_INTEGRATOR is not set
++# CONFIG_ARCH_REALVIEW is not set
++# CONFIG_ARCH_VERSATILE is not set
++# CONFIG_ARCH_AT91 is not set
++# CONFIG_ARCH_CLPS7500 is not set
++# CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_CO285 is not set
++# CONFIG_ARCH_EBSA110 is not set
++# CONFIG_ARCH_EP93XX is not set
++# CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_NETX is not set
++# CONFIG_ARCH_H720X is not set
++# CONFIG_ARCH_IMX is not set
++# CONFIG_ARCH_IOP32X is not set
++# CONFIG_ARCH_IOP33X is not set
++# CONFIG_ARCH_IOP13XX is not set
++# CONFIG_ARCH_IXP4XX is not set
++# CONFIG_ARCH_IXP2000 is not set
++# CONFIG_ARCH_IXP23XX is not set
++# CONFIG_ARCH_L7200 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_PNX4008 is not set
++CONFIG_ARCH_PXA=y
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++# CONFIG_ARCH_S3C2410 is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_OMAP is not set
++CONFIG_DMABOUNCE=y
++
++#
++# Intel PXA2xx Implementations
++#
++# CONFIG_ARCH_LUBBOCK is not set
++# CONFIG_MACH_LOGICPD_PXA270 is not set
++# CONFIG_MACH_MAINSTONE is not set
++# CONFIG_ARCH_PXA_IDP is not set
++# CONFIG_PXA_SHARPSL is not set
++# CONFIG_MACH_TRIZEPS4 is not set
++CONFIG_MACH_ARMCORE=y
++CONFIG_PXA27x=y
++
++#
++# Processor Type
++#
++CONFIG_CPU_32=y
++CONFIG_CPU_XSCALE=y
++CONFIG_CPU_32v5=y
++CONFIG_CPU_ABRT_EV5T=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_OUTER_CACHE is not set
++CONFIG_IWMMXT=y
++CONFIG_XSCALE_PMU=y
++
++#
++# Bus support
++#
++CONFIG_PCI=y
++CONFIG_PCI_HOST_ITE8152=y
++# CONFIG_PCI_DEBUG is not set
++
++#
++# PCCARD (PCMCIA/CardBus) support
++#
++CONFIG_PCCARD=y
++# CONFIG_PCMCIA_DEBUG is not set
++CONFIG_PCMCIA=m
++# CONFIG_PCMCIA_LOAD_CIS is not set
++CONFIG_PCMCIA_IOCTL=y
++CONFIG_CARDBUS=y
++
++#
++# PC-card bridges
++#
++# CONFIG_YENTA is not set
++# CONFIG_PD6729 is not set
++# CONFIG_I82092 is not set
++CONFIG_PCMCIA_PXA2XX=m
++
++#
++# Kernel Features
++#
++# CONFIG_PREEMPT is not set
++# CONFIG_NO_IDLE_HZ is not set
++CONFIG_HZ=100
++# CONFIG_AEABI is not set
++# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
++CONFIG_SELECT_MEMORY_MODEL=y
++CONFIG_FLATMEM_MANUAL=y
++# CONFIG_DISCONTIGMEM_MANUAL is not set
++# CONFIG_SPARSEMEM_MANUAL is not set
++CONFIG_FLATMEM=y
++CONFIG_FLAT_NODE_MEM_MAP=y
++# CONFIG_SPARSEMEM_STATIC is not set
++CONFIG_SPLIT_PTLOCK_CPUS=4096
++# CONFIG_RESOURCES_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=1
++CONFIG_ALIGNMENT_TRAP=y
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE=""
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++CONFIG_FPE_NWFPE=y
++# CONFIG_FPE_NWFPE_XP is not set
++# CONFIG_FPE_FASTFPE is not set
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++# CONFIG_ARTHUR is not set
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_LEGACY is not set
++# CONFIG_PM_DEBUG is not set
++# CONFIG_PM_SYSFS_DEPRECATED is not set
++# CONFIG_APM_EMULATION is not set
++
++#
++# Networking
++#
++CONFIG_NET=y
++
++#
++# Networking options
++#
++# CONFIG_NETDEBUG is not set
++CONFIG_PACKET=y
++# CONFIG_PACKET_MMAP is not set
++CONFIG_UNIX=y
++CONFIG_XFRM=y
++# CONFIG_XFRM_USER is not set
++# CONFIG_XFRM_SUB_POLICY is not set
++# CONFIG_XFRM_MIGRATE is not set
++# CONFIG_NET_KEY is not set
++CONFIG_INET=y
++# CONFIG_IP_MULTICAST is not set
++# CONFIG_IP_ADVANCED_ROUTER is not set
++CONFIG_IP_FIB_HASH=y
++CONFIG_IP_PNP=y
++CONFIG_IP_PNP_DHCP=y
++CONFIG_IP_PNP_BOOTP=y
++# CONFIG_IP_PNP_RARP is not set
++# CONFIG_NET_IPIP is not set
++# CONFIG_NET_IPGRE is not set
++# CONFIG_ARPD is not set
++# CONFIG_SYN_COOKIES is not set
++# CONFIG_INET_AH is not set
++# CONFIG_INET_ESP is not set
++# CONFIG_INET_IPCOMP is not set
++# CONFIG_INET_XFRM_TUNNEL is not set
++# CONFIG_INET_TUNNEL is not set
++CONFIG_INET_XFRM_MODE_TRANSPORT=y
++CONFIG_INET_XFRM_MODE_TUNNEL=y
++CONFIG_INET_XFRM_MODE_BEET=y
++CONFIG_INET_DIAG=y
++CONFIG_INET_TCP_DIAG=y
++# CONFIG_TCP_CONG_ADVANCED is not set
++CONFIG_TCP_CONG_CUBIC=y
++CONFIG_DEFAULT_TCP_CONG="cubic"
++# CONFIG_TCP_MD5SIG is not set
++# CONFIG_IPV6 is not set
++# CONFIG_INET6_XFRM_TUNNEL is not set
++# CONFIG_INET6_TUNNEL is not set
++# CONFIG_NETWORK_SECMARK is not set
++# CONFIG_NETFILTER is not set
++
++#
++# DCCP Configuration (EXPERIMENTAL)
++#
++# CONFIG_IP_DCCP is not set
++
++#
++# SCTP Configuration (EXPERIMENTAL)
++#
++# CONFIG_IP_SCTP is not set
++
++#
++# TIPC Configuration (EXPERIMENTAL)
++#
++# CONFIG_TIPC is not set
++# CONFIG_ATM is not set
++# CONFIG_BRIDGE is not set
++# CONFIG_VLAN_8021Q is not set
++# CONFIG_DECNET is not set
++# CONFIG_LLC2 is not set
++# CONFIG_IPX is not set
++# CONFIG_ATALK is not set
++# CONFIG_X25 is not set
++# CONFIG_LAPB is not set
++# CONFIG_ECONET is not set
++# CONFIG_WAN_ROUTER is not set
++
++#
++# QoS and/or fair queueing
++#
++# CONFIG_NET_SCHED is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_IRDA is not set
++# CONFIG_BT is not set
++CONFIG_IEEE80211=m
++# CONFIG_IEEE80211_DEBUG is not set
++CONFIG_IEEE80211_CRYPT_WEP=m
++CONFIG_IEEE80211_CRYPT_CCMP=m
++# CONFIG_IEEE80211_CRYPT_TKIP is not set
++# CONFIG_IEEE80211_SOFTMAC is not set
++CONFIG_WIRELESS_EXT=y
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++CONFIG_FW_LOADER=y
++# CONFIG_DEBUG_DRIVER is not set
++# CONFIG_DEBUG_DEVRES is not set
++# CONFIG_SYS_HYPERVISOR is not set
++
++#
++# Connector - unified userspace <-> kernelspace linker
++#
++# CONFIG_CONNECTOR is not set
++
++#
++# Memory Technology Devices (MTD)
++#
++CONFIG_MTD=m
++# CONFIG_MTD_DEBUG is not set
++# CONFIG_MTD_CONCAT is not set
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_REDBOOT_PARTS is not set
++# CONFIG_MTD_AFS_PARTS is not set
++
++#
++# User Modules And Translation Layers
++#
++CONFIG_MTD_CHAR=m
++CONFIG_MTD_BLKDEVS=m
++CONFIG_MTD_BLOCK=m
++# CONFIG_MTD_BLOCK_RO is not set
++# CONFIG_FTL is not set
++# CONFIG_NFTL is not set
++# CONFIG_INFTL is not set
++# CONFIG_RFD_FTL is not set
++# CONFIG_SSFDC is not set
++
++#
++# RAM/ROM/Flash chip drivers
++#
++# CONFIG_MTD_CFI is not set
++# CONFIG_MTD_JEDECPROBE is not set
++CONFIG_MTD_MAP_BANK_WIDTH_1=y
++CONFIG_MTD_MAP_BANK_WIDTH_2=y
++CONFIG_MTD_MAP_BANK_WIDTH_4=y
++# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
++CONFIG_MTD_CFI_I1=y
++CONFIG_MTD_CFI_I2=y
++# CONFIG_MTD_CFI_I4 is not set
++# CONFIG_MTD_CFI_I8 is not set
++# CONFIG_MTD_RAM is not set
++# CONFIG_MTD_ROM is not set
++# CONFIG_MTD_ABSENT is not set
++# CONFIG_MTD_OBSOLETE_CHIPS is not set
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++# CONFIG_MTD_SHARP_SL is not set
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_PMC551 is not set
++# CONFIG_MTD_SLRAM is not set
++# CONFIG_MTD_PHRAM is not set
++# CONFIG_MTD_MTDRAM is not set
++# CONFIG_MTD_BLOCK2MTD is not set
++
++#
++# Disk-On-Chip Device Drivers
++#
++# CONFIG_MTD_DOC2000 is not set
++# CONFIG_MTD_DOC2001 is not set
++# CONFIG_MTD_DOC2001PLUS is not set
++
++#
++# NAND Flash Device Drivers
++#
++CONFIG_MTD_NAND=m
++# CONFIG_MTD_NAND_VERIFY_WRITE is not set
++# CONFIG_MTD_NAND_ECC_SMC is not set
++# CONFIG_MTD_NAND_H1900 is not set
++CONFIG_MTD_NAND_IDS=m
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_SHARPSL is not set
++# CONFIG_MTD_NAND_CAFE is not set
++CONFIG_MTD_NAND_CM_X270=m
++# CONFIG_MTD_NAND_NANDSIM is not set
++
++#
++# OneNAND Flash Device Drivers
++#
++# CONFIG_MTD_ONENAND is not set
++
++#
++# Parallel port support
++#
++# CONFIG_PARPORT is not set
++
++#
++# Plug and Play support
++#
++# CONFIG_PNPACPI is not set
++
++#
++# Block devices
++#
++# CONFIG_BLK_CPQ_DA is not set
++# CONFIG_BLK_CPQ_CISS_DA is not set
++# CONFIG_BLK_DEV_DAC960 is not set
++# CONFIG_BLK_DEV_UMEM is not set
++# CONFIG_BLK_DEV_COW_COMMON is not set
++CONFIG_BLK_DEV_LOOP=y
++# CONFIG_BLK_DEV_CRYPTOLOOP is not set
++# CONFIG_BLK_DEV_NBD is not set
++# CONFIG_BLK_DEV_SX8 is not set
++# CONFIG_BLK_DEV_UB is not set
++CONFIG_BLK_DEV_RAM=y
++CONFIG_BLK_DEV_RAM_COUNT=16
++CONFIG_BLK_DEV_RAM_SIZE=12000
++CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++
++#
++# ATA/ATAPI/MFM/RLL support
++#
++CONFIG_IDE=m
++CONFIG_IDE_MAX_HWIFS=4
++CONFIG_BLK_DEV_IDE=m
++
++#
++# Please see Documentation/ide.txt for help/info on IDE drives
++#
++# CONFIG_BLK_DEV_IDE_SATA is not set
++CONFIG_BLK_DEV_IDEDISK=m
++# CONFIG_IDEDISK_MULTI_MODE is not set
++CONFIG_BLK_DEV_IDECS=m
++# CONFIG_BLK_DEV_DELKIN is not set
++CONFIG_BLK_DEV_IDECD=m
++# CONFIG_BLK_DEV_IDETAPE is not set
++# CONFIG_BLK_DEV_IDEFLOPPY is not set
++# CONFIG_BLK_DEV_IDESCSI is not set
++# CONFIG_IDE_TASK_IOCTL is not set
++
++#
++# IDE chipset support/bugfixes
++#
++# CONFIG_IDE_GENERIC is not set
++# CONFIG_BLK_DEV_IDEPCI is not set
++# CONFIG_IDE_ARM is not set
++CONFIG_BLK_DEV_IDE_CM_X270=m
++# CONFIG_BLK_DEV_IDEDMA is not set
++# CONFIG_BLK_DEV_HD is not set
++
++#
++# SCSI device support
++#
++# CONFIG_RAID_ATTRS is not set
++CONFIG_SCSI=y
++# CONFIG_SCSI_TGT is not set
++# CONFIG_SCSI_NETLINK is not set
++# CONFIG_SCSI_PROC_FS is not set
++
++#
++# SCSI support type (disk, tape, CD-ROM)
++#
++CONFIG_BLK_DEV_SD=y
++# CONFIG_CHR_DEV_ST is not set
++# CONFIG_CHR_DEV_OSST is not set
++# CONFIG_BLK_DEV_SR is not set
++# CONFIG_CHR_DEV_SG is not set
++# CONFIG_CHR_DEV_SCH is not set
++
++#
++# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
++#
++# CONFIG_SCSI_MULTI_LUN is not set
++# CONFIG_SCSI_CONSTANTS is not set
++# CONFIG_SCSI_LOGGING is not set
++# CONFIG_SCSI_SCAN_ASYNC is not set
++
++#
++# SCSI Transports
++#
++# CONFIG_SCSI_SPI_ATTRS is not set
++# CONFIG_SCSI_FC_ATTRS is not set
++# CONFIG_SCSI_ISCSI_ATTRS is not set
++# CONFIG_SCSI_SAS_ATTRS is not set
++# CONFIG_SCSI_SAS_LIBSAS is not set
++
++#
++# SCSI low-level drivers
++#
++# CONFIG_ISCSI_TCP is not set
++# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
++# CONFIG_SCSI_3W_9XXX is not set
++# CONFIG_SCSI_ACARD is not set
++# CONFIG_SCSI_AACRAID is not set
++# CONFIG_SCSI_AIC7XXX is not set
++# CONFIG_SCSI_AIC7XXX_OLD is not set
++# CONFIG_SCSI_AIC79XX is not set
++# CONFIG_SCSI_AIC94XX is not set
++# CONFIG_SCSI_DPT_I2O is not set
++# CONFIG_SCSI_ARCMSR is not set
++# CONFIG_MEGARAID_NEWGEN is not set
++# CONFIG_MEGARAID_LEGACY is not set
++# CONFIG_MEGARAID_SAS is not set
++# CONFIG_SCSI_HPTIOP is not set
++# CONFIG_SCSI_DMX3191D is not set
++# CONFIG_SCSI_FUTURE_DOMAIN is not set
++# CONFIG_SCSI_IPS is not set
++# CONFIG_SCSI_INITIO is not set
++# CONFIG_SCSI_INIA100 is not set
++# CONFIG_SCSI_STEX is not set
++# CONFIG_SCSI_SYM53C8XX_2 is not set
++# CONFIG_SCSI_QLOGIC_1280 is not set
++# CONFIG_SCSI_QLA_FC is not set
++# CONFIG_SCSI_QLA_ISCSI is not set
++# CONFIG_SCSI_LPFC is not set
++# CONFIG_SCSI_DC395x is not set
++# CONFIG_SCSI_DC390T is not set
++# CONFIG_SCSI_NSP32 is not set
++# CONFIG_SCSI_DEBUG is not set
++# CONFIG_SCSI_SRP is not set
++
++#
++# PCMCIA SCSI adapter support
++#
++# CONFIG_PCMCIA_AHA152X is not set
++# CONFIG_PCMCIA_FDOMAIN is not set
++# CONFIG_PCMCIA_NINJA_SCSI is not set
++# CONFIG_PCMCIA_QLOGIC is not set
++# CONFIG_PCMCIA_SYM53C500 is not set
++
++#
++# Serial ATA (prod) and Parallel ATA (experimental) drivers
++#
++# CONFIG_ATA is not set
++
++#
++# Multi-device support (RAID and LVM)
++#
++# CONFIG_MD is not set
++
++#
++# Fusion MPT device support
++#
++# CONFIG_FUSION is not set
++# CONFIG_FUSION_SPI is not set
++# CONFIG_FUSION_FC is not set
++# CONFIG_FUSION_SAS is not set
++
++#
++# IEEE 1394 (FireWire) support
++#
++# CONFIG_IEEE1394 is not set
++
++#
++# I2O device support
++#
++# CONFIG_I2O is not set
++
++#
++# Network device support
++#
++CONFIG_NETDEVICES=y
++# CONFIG_DUMMY is not set
++# CONFIG_BONDING is not set
++# CONFIG_EQUALIZER is not set
++# CONFIG_TUN is not set
++
++#
++# ARCnet devices
++#
++# CONFIG_ARCNET is not set
++
++#
++# PHY device support
++#
++# CONFIG_PHYLIB is not set
++
++#
++# Ethernet (10 or 100Mbit)
++#
++CONFIG_NET_ETHERNET=y
++CONFIG_MII=y
++# CONFIG_HAPPYMEAL is not set
++# CONFIG_SUNGEM is not set
++# CONFIG_CASSINI is not set
++# CONFIG_NET_VENDOR_3COM is not set
++# CONFIG_SMC91X is not set
++CONFIG_DM9000=y
++CONFIG_DM9000_NOEPROM=y
++# CONFIG_SMC911X is not set
++
++#
++# Tulip family network device support
++#
++# CONFIG_NET_TULIP is not set
++# CONFIG_HP100 is not set
++CONFIG_NET_PCI=y
++# CONFIG_PCNET32 is not set
++# CONFIG_AMD8111_ETH is not set
++# CONFIG_ADAPTEC_STARFIRE is not set
++# CONFIG_B44 is not set
++# CONFIG_FORCEDETH is not set
++# CONFIG_DGRS is not set
++# CONFIG_EEPRO100 is not set
++# CONFIG_E100 is not set
++# CONFIG_FEALNX is not set
++# CONFIG_NATSEMI is not set
++# CONFIG_NE2K_PCI is not set
++# CONFIG_8139CP is not set
++CONFIG_8139TOO=m
++# CONFIG_8139TOO_PIO is not set
++# CONFIG_8139TOO_TUNE_TWISTER is not set
++# CONFIG_8139TOO_8129 is not set
++# CONFIG_8139_OLD_RX_RESET is not set
++# CONFIG_SIS900 is not set
++# CONFIG_EPIC100 is not set
++# CONFIG_SUNDANCE is not set
++# CONFIG_TLAN is not set
++# CONFIG_VIA_RHINE is not set
++# CONFIG_SC92031 is not set
++
++#
++# Ethernet (1000 Mbit)
++#
++# CONFIG_ACENIC is not set
++# CONFIG_DL2K is not set
++# CONFIG_E1000 is not set
++# CONFIG_NS83820 is not set
++# CONFIG_HAMACHI is not set
++# CONFIG_YELLOWFIN is not set
++# CONFIG_R8169 is not set
++# CONFIG_SIS190 is not set
++# CONFIG_SKGE is not set
++# CONFIG_SKY2 is not set
++# CONFIG_SK98LIN is not set
++# CONFIG_VIA_VELOCITY is not set
++# CONFIG_TIGON3 is not set
++# CONFIG_BNX2 is not set
++# CONFIG_QLA3XXX is not set
++# CONFIG_ATL1 is not set
++
++#
++# Ethernet (10000 Mbit)
++#
++# CONFIG_CHELSIO_T1 is not set
++# CONFIG_CHELSIO_T3 is not set
++# CONFIG_IXGB is not set
++# CONFIG_S2IO is not set
++# CONFIG_MYRI10GE is not set
++# CONFIG_NETXEN_NIC is not set
++
++#
++# Token Ring devices
++#
++# CONFIG_TR is not set
++
++#
++# Wireless LAN (non-hamradio)
++#
++CONFIG_NET_RADIO=y
++# CONFIG_NET_WIRELESS_RTNETLINK is not set
++
++#
++# Obsolete Wireless cards support (pre-802.11)
++#
++# CONFIG_STRIP is not set
++# CONFIG_PCMCIA_WAVELAN is not set
++# CONFIG_PCMCIA_NETWAVE is not set
++
++#
++# Wireless 802.11 Frequency Hopping cards support
++#
++# CONFIG_PCMCIA_RAYCS is not set
++
++#
++# Wireless 802.11b ISA/PCI cards support
++#
++# CONFIG_IPW2100 is not set
++# CONFIG_IPW2200 is not set
++# CONFIG_HERMES is not set
++# CONFIG_ATMEL is not set
++
++#
++# Wireless 802.11b Pcmcia/Cardbus cards support
++#
++# CONFIG_AIRO_CS is not set
++# CONFIG_PCMCIA_WL3501 is not set
++
++#
++# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
++#
++# CONFIG_PRISM54 is not set
++# CONFIG_USB_ZD1201 is not set
++# CONFIG_HOSTAP is not set
++CONFIG_NET_WIRELESS=y
++
++#
++# PCMCIA network device support
++#
++CONFIG_NET_PCMCIA=y
++# CONFIG_PCMCIA_3C589 is not set
++# CONFIG_PCMCIA_3C574 is not set
++# CONFIG_PCMCIA_FMVJ18X is not set
++CONFIG_PCMCIA_PCNET=m
++# CONFIG_PCMCIA_NMCLAN is not set
++# CONFIG_PCMCIA_SMC91C92 is not set
++# CONFIG_PCMCIA_XIRC2PS is not set
++# CONFIG_PCMCIA_AXNET is not set
++
++#
++# Wan interfaces
++#
++# CONFIG_WAN is not set
++# CONFIG_FDDI is not set
++# CONFIG_HIPPI is not set
++# CONFIG_PPP is not set
++# CONFIG_SLIP is not set
++# CONFIG_NET_FC is not set
++# CONFIG_SHAPER is not set
++# CONFIG_NETCONSOLE is not set
++# CONFIG_NETPOLL is not set
++# CONFIG_NET_POLL_CONTROLLER is not set
++
++#
++# ISDN subsystem
++#
++# CONFIG_ISDN is not set
++
++#
++# Input device support
++#
++CONFIG_INPUT=y
++# CONFIG_INPUT_FF_MEMLESS is not set
++
++#
++# Userland interfaces
++#
++# CONFIG_INPUT_MOUSEDEV is not set
++# CONFIG_INPUT_JOYDEV is not set
++# CONFIG_INPUT_TSDEV is not set
++CONFIG_INPUT_EVDEV=y
++# CONFIG_INPUT_EVBUG is not set
++
++#
++# Input Device Drivers
++#
++# CONFIG_INPUT_KEYBOARD is not set
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_INPUT_JOYSTICK is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_MK712 is not set
++# CONFIG_TOUCHSCREEN_PENMOUNT is not set
++# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
++# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
++CONFIG_TOUCHSCREEN_UCB1400=m
++# CONFIG_INPUT_MISC is not set
++
++#
++# Hardware I/O ports
++#
++# CONFIG_SERIO is not set
++# CONFIG_GAMEPORT is not set
++
++#
++# Character devices
++#
++CONFIG_VT=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++# CONFIG_VT_HW_CONSOLE_BINDING is not set
++# CONFIG_SERIAL_NONSTANDARD is not set
++
++#
++# Serial drivers
++#
++# CONFIG_SERIAL_8250 is not set
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_PXA=y
++CONFIG_SERIAL_PXA_CONSOLE=y
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++# CONFIG_SERIAL_JSM is not set
++CONFIG_UNIX98_PTYS=y
++CONFIG_LEGACY_PTYS=y
++CONFIG_LEGACY_PTY_COUNT=256
++
++#
++# IPMI
++#
++# CONFIG_IPMI_HANDLER is not set
++
++#
++# Watchdog Cards
++#
++# CONFIG_WATCHDOG is not set
++CONFIG_HW_RANDOM=m
++# CONFIG_NVRAM is not set
++# CONFIG_DTLK is not set
++# CONFIG_R3964 is not set
++# CONFIG_APPLICOM is not set
++# CONFIG_DRM is not set
++
++#
++# PCMCIA character devices
++#
++# CONFIG_SYNCLINK_CS is not set
++# CONFIG_CARDMAN_4000 is not set
++# CONFIG_CARDMAN_4040 is not set
++# CONFIG_RAW_DRIVER is not set
++
++#
++# TPM devices
++#
++# CONFIG_TCG_TPM is not set
++
++#
++# I2C support
++#
++# CONFIG_I2C is not set
++
++#
++# SPI support
++#
++# CONFIG_SPI is not set
++# CONFIG_SPI_MASTER is not set
++
++#
++# Dallas's 1-wire bus
++#
++# CONFIG_W1 is not set
++
++#
++# Hardware Monitoring support
++#
++# CONFIG_HWMON is not set
++# CONFIG_HWMON_VID is not set
++
++#
++# Misc devices
++#
++# CONFIG_SGI_IOC4 is not set
++# CONFIG_TIFM_CORE is not set
++
++#
++# Multifunction device drivers
++#
++# CONFIG_MFD_SM501 is not set
++
++#
++# LED devices
++#
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++CONFIG_LEDS_CM_X270=y
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGERS=y
++# CONFIG_LEDS_TRIGGER_TIMER is not set
++# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++
++#
++# Multimedia devices
++#
++# CONFIG_VIDEO_DEV is not set
++
++#
++# Digital Video Broadcasting Devices
++#
++# CONFIG_DVB is not set
++# CONFIG_USB_DABUSB is not set
++
++#
++# Graphics support
++#
++# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
++CONFIG_FB=y
++# CONFIG_FIRMWARE_EDID is not set
++# CONFIG_FB_DDC is not set
++CONFIG_FB_CFB_FILLRECT=y
++CONFIG_FB_CFB_COPYAREA=y
++CONFIG_FB_CFB_IMAGEBLIT=y
++# CONFIG_FB_SVGALIB is not set
++# CONFIG_FB_MACMODES is not set
++# CONFIG_FB_BACKLIGHT is not set
++# CONFIG_FB_MODE_HELPERS is not set
++# CONFIG_FB_TILEBLITTING is not set
++
++#
++# Frambuffer hardware drivers
++#
++# CONFIG_FB_CIRRUS is not set
++# CONFIG_FB_PM2 is not set
++# CONFIG_FB_CYBER2000 is not set
++# CONFIG_FB_ASILIANT is not set
++# CONFIG_FB_IMSTT is not set
++# CONFIG_FB_S1D13XXX is not set
++# CONFIG_FB_NVIDIA is not set
++# CONFIG_FB_RIVA is not set
++# CONFIG_FB_MATROX is not set
++# CONFIG_FB_RADEON is not set
++# CONFIG_FB_ATY128 is not set
++# CONFIG_FB_ATY is not set
++# CONFIG_FB_S3 is not set
++# CONFIG_FB_SAVAGE is not set
++# CONFIG_FB_SIS is not set
++# CONFIG_FB_NEOMAGIC is not set
++# CONFIG_FB_KYRO is not set
++# CONFIG_FB_3DFX is not set
++# CONFIG_FB_VOODOO1 is not set
++# CONFIG_FB_TRIDENT is not set
++CONFIG_FB_PXA=y
++# CONFIG_FB_PXA_PARAMETERS is not set
++CONFIG_FB_MBX=m
++# CONFIG_FB_VIRTUAL is not set
++
++#
++# Console display driver support
++#
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_DUMMY_CONSOLE=y
++CONFIG_FRAMEBUFFER_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
++# CONFIG_FONTS is not set
++CONFIG_FONT_8x8=y
++CONFIG_FONT_8x16=y
++
++#
++# Logo configuration
++#
++CONFIG_LOGO=y
++CONFIG_LOGO_LINUX_MONO=y
++CONFIG_LOGO_LINUX_VGA16=y
++CONFIG_LOGO_LINUX_CLUT224=y
++
++#
++# Sound
++#
++CONFIG_SOUND=m
++
++#
++# Advanced Linux Sound Architecture
++#
++CONFIG_SND=m
++CONFIG_SND_TIMER=m
++CONFIG_SND_PCM=m
++# CONFIG_SND_SEQUENCER is not set
++CONFIG_SND_OSSEMUL=y
++CONFIG_SND_MIXER_OSS=m
++CONFIG_SND_PCM_OSS=m
++CONFIG_SND_PCM_OSS_PLUGINS=y
++# CONFIG_SND_DYNAMIC_MINORS is not set
++CONFIG_SND_SUPPORT_OLD_API=y
++CONFIG_SND_VERBOSE_PROCFS=y
++# CONFIG_SND_VERBOSE_PRINTK is not set
++# CONFIG_SND_DEBUG is not set
++
++#
++# Generic devices
++#
++CONFIG_SND_AC97_CODEC=m
++# CONFIG_SND_DUMMY is not set
++# CONFIG_SND_MTPAV is not set
++# CONFIG_SND_SERIAL_U16550 is not set
++# CONFIG_SND_MPU401 is not set
++
++#
++# PCI devices
++#
++# CONFIG_SND_AD1889 is not set
++# CONFIG_SND_ALS300 is not set
++# CONFIG_SND_ALI5451 is not set
++# CONFIG_SND_ATIIXP is not set
++# CONFIG_SND_ATIIXP_MODEM is not set
++# CONFIG_SND_AU8810 is not set
++# CONFIG_SND_AU8820 is not set
++# CONFIG_SND_AU8830 is not set
++# CONFIG_SND_AZT3328 is not set
++# CONFIG_SND_BT87X is not set
++# CONFIG_SND_CA0106 is not set
++# CONFIG_SND_CMIPCI is not set
++# CONFIG_SND_CS4281 is not set
++# CONFIG_SND_CS46XX is not set
++# CONFIG_SND_DARLA20 is not set
++# CONFIG_SND_GINA20 is not set
++# CONFIG_SND_LAYLA20 is not set
++# CONFIG_SND_DARLA24 is not set
++# CONFIG_SND_GINA24 is not set
++# CONFIG_SND_LAYLA24 is not set
++# CONFIG_SND_MONA is not set
++# CONFIG_SND_MIA is not set
++# CONFIG_SND_ECHO3G is not set
++# CONFIG_SND_INDIGO is not set
++# CONFIG_SND_INDIGOIO is not set
++# CONFIG_SND_INDIGODJ is not set
++# CONFIG_SND_EMU10K1 is not set
++# CONFIG_SND_EMU10K1X is not set
++# CONFIG_SND_ENS1370 is not set
++# CONFIG_SND_ENS1371 is not set
++# CONFIG_SND_ES1938 is not set
++# CONFIG_SND_ES1968 is not set
++# CONFIG_SND_FM801 is not set
++# CONFIG_SND_HDA_INTEL is not set
++# CONFIG_SND_HDSP is not set
++# CONFIG_SND_HDSPM is not set
++# CONFIG_SND_ICE1712 is not set
++# CONFIG_SND_ICE1724 is not set
++# CONFIG_SND_INTEL8X0 is not set
++# CONFIG_SND_INTEL8X0M is not set
++# CONFIG_SND_KORG1212 is not set
++# CONFIG_SND_MAESTRO3 is not set
++# CONFIG_SND_MIXART is not set
++# CONFIG_SND_NM256 is not set
++# CONFIG_SND_PCXHR is not set
++# CONFIG_SND_RIPTIDE is not set
++# CONFIG_SND_RME32 is not set
++# CONFIG_SND_RME96 is not set
++# CONFIG_SND_RME9652 is not set
++# CONFIG_SND_SONICVIBES is not set
++# CONFIG_SND_TRIDENT is not set
++# CONFIG_SND_VIA82XX is not set
++# CONFIG_SND_VIA82XX_MODEM is not set
++# CONFIG_SND_VX222 is not set
++# CONFIG_SND_YMFPCI is not set
++# CONFIG_SND_AC97_POWER_SAVE is not set
++
++#
++# ALSA ARM devices
++#
++CONFIG_SND_PXA2XX_PCM=m
++CONFIG_SND_PXA2XX_AC97=m
++
++#
++# USB devices
++#
++# CONFIG_SND_USB_AUDIO is not set
++
++#
++# PCMCIA devices
++#
++# CONFIG_SND_VXPOCKET is not set
++# CONFIG_SND_PDAUDIOCF is not set
++
++#
++# SoC audio support
++#
++# CONFIG_SND_SOC is not set
++
++#
++# Open Sound System
++#
++# CONFIG_SOUND_PRIME is not set
++CONFIG_AC97_BUS=m
++
++#
++# HID Devices
++#
++CONFIG_HID=y
++# CONFIG_HID_DEBUG is not set
++
++#
++# USB support
++#
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++CONFIG_USB_ARCH_HAS_EHCI=y
++CONFIG_USB=y
++# CONFIG_USB_DEBUG is not set
++
++#
++# Miscellaneous USB options
++#
++CONFIG_USB_DEVICEFS=y
++# CONFIG_USB_DYNAMIC_MINORS is not set
++# CONFIG_USB_SUSPEND is not set
++# CONFIG_USB_OTG is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_EHCI_HCD is not set
++# CONFIG_USB_ISP116X_HCD is not set
++CONFIG_USB_OHCI_HCD=y
++# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
++# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
++CONFIG_USB_OHCI_LITTLE_ENDIAN=y
++# CONFIG_USB_UHCI_HCD is not set
++# CONFIG_USB_SL811_HCD is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++
++#
++# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
++#
++
++#
++# may also be needed; see USB_STORAGE Help for more information
++#
++CONFIG_USB_STORAGE=y
++# CONFIG_USB_STORAGE_DEBUG is not set
++# CONFIG_USB_STORAGE_DATAFAB is not set
++# CONFIG_USB_STORAGE_FREECOM is not set
++# CONFIG_USB_STORAGE_DPCM is not set
++# CONFIG_USB_STORAGE_USBAT is not set
++# CONFIG_USB_STORAGE_SDDR09 is not set
++# CONFIG_USB_STORAGE_SDDR55 is not set
++# CONFIG_USB_STORAGE_JUMPSHOT is not set
++# CONFIG_USB_STORAGE_ALAUDA is not set
++# CONFIG_USB_STORAGE_KARMA is not set
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Input Devices
++#
++CONFIG_USB_HID=y
++# CONFIG_USB_HIDINPUT_POWERBOOK is not set
++# CONFIG_HID_FF is not set
++# CONFIG_USB_HIDDEV is not set
++# CONFIG_USB_AIPTEK is not set
++# CONFIG_USB_WACOM is not set
++# CONFIG_USB_ACECAD is not set
++# CONFIG_USB_KBTAB is not set
++# CONFIG_USB_POWERMATE is not set
++# CONFIG_USB_TOUCHSCREEN is not set
++# CONFIG_USB_YEALINK is not set
++# CONFIG_USB_XPAD is not set
++# CONFIG_USB_ATI_REMOTE is not set
++# CONFIG_USB_ATI_REMOTE2 is not set
++# CONFIG_USB_KEYSPAN_REMOTE is not set
++# CONFIG_USB_APPLETOUCH is not set
++# CONFIG_USB_GTCO is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++# CONFIG_USB_MICROTEK is not set
++
++#
++# USB Network Adapters
++#
++# CONFIG_USB_CATC is not set
++# CONFIG_USB_KAWETH is not set
++# CONFIG_USB_PEGASUS is not set
++# CONFIG_USB_RTL8150 is not set
++# CONFIG_USB_USBNET_MII is not set
++# CONFIG_USB_USBNET is not set
++CONFIG_USB_MON=y
++
++#
++# USB port drivers
++#
++
++#
++# USB Serial Converter support
++#
++# CONFIG_USB_SERIAL is not set
++
++#
++# USB Miscellaneous drivers
++#
++# CONFIG_USB_EMI62 is not set
++# CONFIG_USB_EMI26 is not set
++# CONFIG_USB_ADUTUX is not set
++# CONFIG_USB_AUERSWALD is not set
++# CONFIG_USB_RIO500 is not set
++# CONFIG_USB_LEGOTOWER is not set
++# CONFIG_USB_LCD is not set
++# CONFIG_USB_BERRY_CHARGE is not set
++# CONFIG_USB_LED is not set
++# CONFIG_USB_CYPRESS_CY7C63 is not set
++# CONFIG_USB_CYTHERM is not set
++# CONFIG_USB_PHIDGET is not set
++# CONFIG_USB_IDMOUSE is not set
++# CONFIG_USB_FTDI_ELAN is not set
++# CONFIG_USB_APPLEDISPLAY is not set
++# CONFIG_USB_LD is not set
++# CONFIG_USB_TRANCEVIBRATOR is not set
++# CONFIG_USB_IOWARRIOR is not set
++# CONFIG_USB_TEST is not set
++
++#
++# USB DSL modem support
++#
++
++#
++# USB Gadget Support
++#
++# CONFIG_USB_GADGET is not set
++
++#
++# MMC/SD Card support
++#
++CONFIG_MMC=m
++# CONFIG_MMC_DEBUG is not set
++CONFIG_MMC_BLOCK=m
++CONFIG_MMC_PXA=m
++# CONFIG_MMC_SDHCI is not set
++# CONFIG_MMC_TIFM_SD is not set
++
++#
++# Real Time Clock
++#
++CONFIG_RTC_LIB=y
++CONFIG_RTC_CLASS=y
++CONFIG_RTC_HCTOSYS=y
++CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
++# CONFIG_RTC_DEBUG is not set
++
++#
++# RTC interfaces
++#
++CONFIG_RTC_INTF_SYSFS=y
++CONFIG_RTC_INTF_PROC=y
++CONFIG_RTC_INTF_DEV=y
++# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
++
++#
++# RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++CONFIG_RTC_DRV_SA1100=y
++# CONFIG_RTC_DRV_TEST is not set
++CONFIG_RTC_DRV_V3020=y
++
++#
++# File systems
++#
++CONFIG_EXT2_FS=y
++# CONFIG_EXT2_FS_XATTR is not set
++# CONFIG_EXT2_FS_XIP is not set
++CONFIG_EXT3_FS=y
++CONFIG_EXT3_FS_XATTR=y
++# CONFIG_EXT3_FS_POSIX_ACL is not set
++# CONFIG_EXT3_FS_SECURITY is not set
++# CONFIG_EXT4DEV_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++CONFIG_FS_MBCACHE=y
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++# CONFIG_XFS_FS is not set
++# CONFIG_GFS2_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_ROMFS_FS is not set
++CONFIG_INOTIFY=y
++CONFIG_INOTIFY_USER=y
++# CONFIG_QUOTA is not set
++CONFIG_DNOTIFY=y
++# CONFIG_AUTOFS_FS is not set
++# CONFIG_AUTOFS4_FS is not set
++# CONFIG_FUSE_FS is not set
++
++#
++# CD-ROM/DVD Filesystems
++#
++# CONFIG_ISO9660_FS is not set
++# CONFIG_UDF_FS is not set
++
++#
++# DOS/FAT/NT Filesystems
++#
++CONFIG_FAT_FS=y
++CONFIG_MSDOS_FS=y
++CONFIG_VFAT_FS=y
++CONFIG_FAT_DEFAULT_CODEPAGE=437
++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
++# CONFIG_NTFS_FS is not set
++
++#
++# Pseudo filesystems
++#
++CONFIG_PROC_FS=y
++CONFIG_PROC_SYSCTL=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++CONFIG_RAMFS=y
++# CONFIG_CONFIGFS_FS is not set
++
++#
++# Miscellaneous filesystems
++#
++# CONFIG_ADFS_FS is not set
++# CONFIG_AFFS_FS is not set
++# CONFIG_HFS_FS is not set
++# CONFIG_HFSPLUS_FS is not set
++# CONFIG_BEFS_FS is not set
++# CONFIG_BFS_FS is not set
++# CONFIG_EFS_FS is not set
++# CONFIG_JFFS2_FS is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++
++#
++# Network File Systems
++#
++CONFIG_NFS_FS=y
++CONFIG_NFS_V3=y
++# CONFIG_NFS_V3_ACL is not set
++# CONFIG_NFS_V4 is not set
++# CONFIG_NFS_DIRECTIO is not set
++# CONFIG_NFSD is not set
++CONFIG_ROOT_NFS=y
++CONFIG_LOCKD=y
++CONFIG_LOCKD_V4=y
++CONFIG_NFS_COMMON=y
++CONFIG_SUNRPC=y
++# CONFIG_RPCSEC_GSS_KRB5 is not set
++# CONFIG_RPCSEC_GSS_SPKM3 is not set
++CONFIG_SMB_FS=y
++# CONFIG_SMB_NLS_DEFAULT is not set
++# CONFIG_CIFS is not set
++# CONFIG_NCP_FS is not set
++# CONFIG_CODA_FS is not set
++# CONFIG_AFS_FS is not set
++# CONFIG_9P_FS is not set
++
++#
++# Partition Types
++#
++# CONFIG_PARTITION_ADVANCED is not set
++CONFIG_MSDOS_PARTITION=y
++
++#
++# Native Language Support
++#
++CONFIG_NLS=y
++CONFIG_NLS_DEFAULT="iso8859-1"
++CONFIG_NLS_CODEPAGE_437=y
++# CONFIG_NLS_CODEPAGE_737 is not set
++# CONFIG_NLS_CODEPAGE_775 is not set
++# CONFIG_NLS_CODEPAGE_850 is not set
++# CONFIG_NLS_CODEPAGE_852 is not set
++# CONFIG_NLS_CODEPAGE_855 is not set
++# CONFIG_NLS_CODEPAGE_857 is not set
++# CONFIG_NLS_CODEPAGE_860 is not set
++# CONFIG_NLS_CODEPAGE_861 is not set
++# CONFIG_NLS_CODEPAGE_862 is not set
++# CONFIG_NLS_CODEPAGE_863 is not set
++# CONFIG_NLS_CODEPAGE_864 is not set
++# CONFIG_NLS_CODEPAGE_865 is not set
++# CONFIG_NLS_CODEPAGE_866 is not set
++# CONFIG_NLS_CODEPAGE_869 is not set
++# CONFIG_NLS_CODEPAGE_936 is not set
++# CONFIG_NLS_CODEPAGE_950 is not set
++# CONFIG_NLS_CODEPAGE_932 is not set
++# CONFIG_NLS_CODEPAGE_949 is not set
++# CONFIG_NLS_CODEPAGE_874 is not set
++# CONFIG_NLS_ISO8859_8 is not set
++# CONFIG_NLS_CODEPAGE_1250 is not set
++# CONFIG_NLS_CODEPAGE_1251 is not set
++# CONFIG_NLS_ASCII is not set
++CONFIG_NLS_ISO8859_1=y
++# CONFIG_NLS_ISO8859_2 is not set
++# CONFIG_NLS_ISO8859_3 is not set
++# CONFIG_NLS_ISO8859_4 is not set
++# CONFIG_NLS_ISO8859_5 is not set
++# CONFIG_NLS_ISO8859_6 is not set
++# CONFIG_NLS_ISO8859_7 is not set
++# CONFIG_NLS_ISO8859_9 is not set
++# CONFIG_NLS_ISO8859_13 is not set
++# CONFIG_NLS_ISO8859_14 is not set
++# CONFIG_NLS_ISO8859_15 is not set
++# CONFIG_NLS_KOI8_R is not set
++# CONFIG_NLS_KOI8_U is not set
++# CONFIG_NLS_UTF8 is not set
++
++#
++# Distributed Lock Manager
++#
++# CONFIG_DLM is not set
++
++#
++# Profiling support
++#
++# CONFIG_PROFILING is not set
++
++#
++# Kernel hacking
++#
++# CONFIG_PRINTK_TIME is not set
++CONFIG_ENABLE_MUST_CHECK=y
++CONFIG_MAGIC_SYSRQ=y
++# CONFIG_UNUSED_SYMBOLS is not set
++# CONFIG_DEBUG_FS is not set
++# CONFIG_HEADERS_CHECK is not set
++CONFIG_DEBUG_KERNEL=y
++# CONFIG_DEBUG_SHIRQ is not set
++CONFIG_LOG_BUF_SHIFT=17
++# CONFIG_DETECT_SOFTLOCKUP is not set
++# CONFIG_SCHEDSTATS is not set
++# CONFIG_TIMER_STATS is not set
++# CONFIG_DEBUG_SLAB is not set
++# CONFIG_DEBUG_RT_MUTEXES is not set
++# CONFIG_RT_MUTEX_TESTER is not set
++# CONFIG_DEBUG_SPINLOCK is not set
++# CONFIG_DEBUG_MUTEXES is not set
++# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
++# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
++# CONFIG_DEBUG_KOBJECT is not set
++# CONFIG_DEBUG_BUGVERBOSE is not set
++CONFIG_DEBUG_INFO=y
++# CONFIG_DEBUG_VM is not set
++# CONFIG_DEBUG_LIST is not set
++CONFIG_FRAME_POINTER=y
++CONFIG_FORCED_INLINING=y
++# CONFIG_RCU_TORTURE_TEST is not set
++# CONFIG_FAULT_INJECTION is not set
++CONFIG_DEBUG_USER=y
++CONFIG_DEBUG_ERRORS=y
++CONFIG_DEBUG_LL=y
++# CONFIG_DEBUG_ICEDCC is not set
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY is not set
++
++#
++# Cryptographic options
++#
++CONFIG_CRYPTO=y
++CONFIG_CRYPTO_ALGAPI=m
++CONFIG_CRYPTO_BLKCIPHER=m
++CONFIG_CRYPTO_MANAGER=m
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_MD4 is not set
++# CONFIG_CRYPTO_MD5 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_WP512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++CONFIG_CRYPTO_ECB=m
++CONFIG_CRYPTO_CBC=m
++CONFIG_CRYPTO_PCBC=m
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++# CONFIG_CRYPTO_SERPENT is not set
++CONFIG_CRYPTO_AES=m
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_TEA is not set
++CONFIG_CRYPTO_ARC4=m
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_DEFLATE is not set
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Hardware crypto devices
++#
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++# CONFIG_CRC_CCITT is not set
++# CONFIG_CRC16 is not set
++CONFIG_CRC32=y
++# CONFIG_LIBCRC32C is not set
++CONFIG_PLIST=y
++CONFIG_HAS_IOMEM=y
++CONFIG_HAS_IOPORT=y
+diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
+index 5ebec6d..e126926 100644
+--- a/arch/arm/mach-pxa/Kconfig
++++ b/arch/arm/mach-pxa/Kconfig
+@@ -40,6 +40,12 @@ config MACH_TRIZEPS4
+ config MACH_EM_X270
+ bool "CompuLab EM-x270 platform"
+ select PXA27x
++ select IWMMXT
++
++config MACH_ARMCORE
++ bool "CompuLab CM-X270 modules"
++ select PXA27x
++ select IWMMXT
+
+ endchoice
+
+diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
+index 7d6ab5c..b369289 100644
+--- a/arch/arm/mach-pxa/Makefile
++++ b/arch/arm/mach-pxa/Makefile
+@@ -19,6 +19,7 @@ obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
+ obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o
+ obj-$(CONFIG_MACH_TOSA) += tosa.o
+ obj-$(CONFIG_MACH_EM_X270) += em-x270.o
++obj-$(CONFIG_MACH_ARMCORE) += cm-x270.o
+
+ # Support for blinky lights
+ led-y := leds.o
+@@ -26,6 +27,8 @@ led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o
+ led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o
+ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
+ led-$(CONFIG_MACH_TRIZEPS4) += leds-trizeps4.o
++# FIXME: use driver/leds instead
++led-$(CONFIG_MACH_ARMCORE) += leds-cm-x270.o
+
+ obj-$(CONFIG_LEDS) += $(led-y)
+
+@@ -36,3 +39,7 @@ obj-$(CONFIG_PXA_SSP) += ssp.o
+ ifeq ($(CONFIG_PXA27x),y)
+ obj-$(CONFIG_PM) += standby.o
+ endif
++
++ifeq ($(CONFIG_PCI),y)
++obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o
++endif
+diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
+new file mode 100644
+index 0000000..7b4e288
+--- /dev/null
++++ b/arch/arm/mach-pxa/cm-x270.c
+@@ -0,0 +1,821 @@
++/*
++ * linux/arch/arm/mach-pxa/cm-x270.c
++ *
++ * Copyright (C) 2007 CompuLab, Ltd.
++ * Mike Rapoport <mike@compulab.co.il>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/pm.h>
++#include <linux/fb.h>
++#include <linux/platform_device.h>
++#include <linux/sysdev.h>
++#include <linux/dm9000.h>
++#include <linux/rtc-v3020.h>
++#include <linux/serial_8250.h>
++#include <video/mbxfb.h>
++
++#include <asm/types.h>
++#include <asm/setup.h>
++#include <asm/memory.h>
++#include <asm/mach-types.h>
++#include <asm/hardware.h>
++#include <asm/irq.h>
++#include <asm/io.h>
++#include <asm/delay.h>
++
++#include <asm/mach/arch.h>
++#include <asm/mach/map.h>
++#include <asm/mach/irq.h>
++
++#include <asm/arch/pxa-regs.h>
++#include <asm/arch/pxafb.h>
++#include <asm/arch/ohci.h>
++#include <asm/arch/mmc.h>
++#include <asm/arch/bitfield.h>
++#include <asm/arch/cm-x270.h>
++
++#include <asm/hardware/it8152.h>
++
++#include "generic.h"
++
++#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22))
++#define DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22))
++
++static struct resource cmx270_dm9k_resource[] = {
++ [0] = {
++ .start = DM9000_PHYS_BASE,
++ .end = DM9000_PHYS_BASE + 4,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = DM9000_PHYS_BASE + 8,
++ .end = DM9000_PHYS_BASE + 8 + 500,
++ .flags = IORESOURCE_MEM,
++ },
++ [2] = {
++ .start = CMX270_ETHIRQ,
++ .end = CMX270_ETHIRQ,
++ .flags = IORESOURCE_IRQ,
++ }
++};
++
++/* for the moment we limit ourselves to 32bit IO until some
++ * better IO routines can be written and tested
++ */
++static struct dm9000_plat_data cmx270_dm9k_platdata = {
++ .flags = DM9000_PLATF_32BITONLY,
++};
++
++/* Ethernet device */
++static struct platform_device cmx270_device_dm9k = {
++ .name = "dm9000",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(cmx270_dm9k_resource),
++ .resource = cmx270_dm9k_resource,
++ .dev = {
++ .platform_data = &cmx270_dm9k_platdata,
++ }
++};
++
++/* audio device */
++static struct platform_device cmx270_audio_device = {
++ .name = "pxa2xx-ac97",
++ .id = -1,
++};
++
++/* touchscreen controller */
++static struct platform_device cmx270_ts_device = {
++ .name = "ucb1x00-ts",
++ .id = -1,
++};
++
++/* RTC */
++static struct resource cmx270_v3020_resource[] = {
++ [0] = {
++ .start = RTC_PHYS_BASE,
++ .end = RTC_PHYS_BASE + 4,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++struct v3020_platform_data cmx270_v3020_pdata = {
++ .leftshift = 16,
++};
++
++static struct platform_device cmx270_rtc_device = {
++ .name = "v3020",
++ .num_resources = ARRAY_SIZE(cmx270_v3020_resource),
++ .resource = cmx270_v3020_resource,
++ .id = -1,
++ .dev = {
++ .platform_data = &cmx270_v3020_pdata,
++ }
++};
++
++/*
++ * CM-X270 LEDs
++ */
++static struct platform_device cmx270led_device = {
++ .name = "cm-x270-led",
++ .id = -1,
++};
++
++/* 2700G graphics */
++static u64 fb_dma_mask = ~(u64)0;
++
++static struct resource cmx270_2700G_resource[] = {
++ /* frame buffer memory including ODFB and External SDRAM */
++ [0] = {
++ .start = MARATHON_PHYS,
++ .end = MARATHON_PHYS + 0x02000000,
++ .flags = IORESOURCE_MEM,
++ },
++ /* Marathon registers */
++ [1] = {
++ .start = MARATHON_PHYS + 0x03fe0000,
++ .end = MARATHON_PHYS + 0x03ffffff,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++static unsigned long save_lcd_regs[10];
++
++static int cmx270_marathon_probe(struct fb_info *fb)
++{
++ /* save PXA-270 pin settings before enabling 2700G */
++ save_lcd_regs[0] = GPDR1;
++ save_lcd_regs[1] = GPDR2;
++ save_lcd_regs[2] = GAFR1_U;
++ save_lcd_regs[3] = GAFR2_L;
++ save_lcd_regs[4] = GAFR2_U;
++
++ /* Disable PXA-270 on-chip controller driving pins */
++ GPDR1 &= ~(0xfc000000);
++ GPDR2 &= ~(0x00c03fff);
++ GAFR1_U &= ~(0xfff00000);
++ GAFR2_L &= ~(0x0fffffff);
++ GAFR2_U &= ~(0x0000f000);
++ return 0;
++}
++
++static int cmx270_marathon_remove(struct fb_info *fb)
++{
++ GPDR1 = save_lcd_regs[0];
++ GPDR2 = save_lcd_regs[1];
++ GAFR1_U = save_lcd_regs[2];
++ GAFR2_L = save_lcd_regs[3];
++ GAFR2_U = save_lcd_regs[4];
++ return 0;
++}
++
++static struct mbxfb_platform_data cmx270_2700G_data = {
++ .xres = {
++ .min = 240,
++ .max = 1200,
++ .defval = 640,
++ },
++ .yres = {
++ .min = 240,
++ .max = 1200,
++ .defval = 480,
++ },
++ .bpp = {
++ .min = 16,
++ .max = 32,
++ .defval = 16,
++ },
++ .memsize = 8*1024*1024,
++ .probe = cmx270_marathon_probe,
++ .remove = cmx270_marathon_remove,
++};
++
++static struct platform_device cmx270_2700G = {
++ .name = "mbx-fb",
++ .dev = {
++ .platform_data = &cmx270_2700G_data,
++ .dma_mask = &fb_dma_mask,
++ .coherent_dma_mask = 0xffffffff,
++ },
++ .num_resources = ARRAY_SIZE(cmx270_2700G_resource),
++ .resource = cmx270_2700G_resource,
++ .id = -1,
++};
++
++/* platform devices */
++static struct platform_device *platform_devices[] __initdata = {
++ &cmx270_device_dm9k,
++ &cmx270_audio_device,
++ &cmx270_rtc_device,
++ &cmx270_2700G,
++ &cmx270led_device,
++};
++
++#ifdef CONFIG_PCI
++/*
++ * Install handler for IT8152 IRQ. Yes, yes... we are way down the IRQ
++ * cascade which is not good for IRQ latency, but the hardware has been
++ * designed that way...
++ */
++static inline void cmx270_irq(int irq, struct pt_regs *regs)
++{
++ struct irq_desc *desc;
++ desc = irq_desc + irq;
++ desc_handle_irq(irq, desc);
++}
++
++static void cmx270_irq_demux(unsigned int irq, struct irqdesc *desc,
++ struct pt_regs *regs)
++{
++ unsigned long pdcnimr, ldcnimr;
++ int pdcnirr, ldcnir;
++
++ /* clear our parent irq */
++ GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ);
++
++ /* read pending IRQs in the chip registers and clear them */
++ pdcnirr = IT8152_INTC_PDCNIRR;
++ ldcnir = IT8152_INTC_LDCNIRR;
++ IT8152_INTC_PDCNIRR = ~pdcnirr;
++ IT8152_INTC_LDCNIRR = ~ldcnir;
++
++ /* mask ITE irqs */
++ pdcnimr = IT8152_INTC_PDCNIMR;
++ ldcnimr = IT8152_INTC_LDCNIMR;
++ IT8152_INTC_PDCNIMR = 0xffff;
++ IT8152_INTC_LDCNIMR = 0xffff;
++
++ pdcnirr &= (PCISERR_BIT | H2PTADR_BIT | H2PMAR_BIT |
++ PCI_INTD_BIT | PCI_INTC_BIT | PCI_INTB_BIT | PCI_INTA_BIT |
++ USB_INT_BIT | CDMA_INT_BIT);
++
++ ldcnir &= ITESER_BIT;
++
++ IT8152_INTC_PDCNIRR = ~pdcnirr;
++ IT8152_INTC_LDCNIRR = ~ldcnir;
++
++ /* are there interrupts pending ? */
++ if( (pdcnirr | ldcnir) ) {
++ if (pdcnirr) {
++ if( pdcnirr & PCISERR_BIT )
++ cmx270_irq(PCISERR, regs);
++ if( pdcnirr & H2PTADR_BIT )
++ cmx270_irq(H2PTADR, regs);
++ if( pdcnirr & H2PMAR_BIT )
++ cmx270_irq(H2PMAR, regs);
++ if( pdcnirr & PCI_INTA_BIT )
++ cmx270_irq(PCI_INTA, regs);
++ if( pdcnirr & PCI_INTB_BIT )
++ cmx270_irq(PCI_INTB, regs);
++ if( pdcnirr & PCI_INTC_BIT )
++ cmx270_irq(PCI_INTC, regs);
++ if( pdcnirr & PCI_INTD_BIT )
++ cmx270_irq(PCI_INTD, regs);
++ if( pdcnirr & USB_INT_BIT )
++ cmx270_irq(USB_INT, regs);
++ if( pdcnirr & CDMA_INT_BIT )
++ cmx270_irq(CDMA_INT, regs);
++ }
++ if(ldcnir) {
++ if( ldcnir & ITESER_BIT )
++ cmx270_irq(IRQ_ITESER, regs);
++ }
++ }
++
++ /* re-enable ITE interrupts */
++ IT8152_INTC_PDCNIMR = pdcnimr;
++ IT8152_INTC_LDCNIMR = ldcnimr;
++}
++#else
++unsigned long it8152_base_address = CMX270_IT8152_VIRT;
++#endif
++
++/* #define CMX270_FLASH_VIRT (CMX270_IDE104_VIRT + PXA_CS_SIZE - (8<<20)) */
++/* Map PCI companion and IDE/General Purpose CS statically */
++static struct map_desc cmx270_io_desc[] __initdata = {
++ [0] = { /* IDE/general purpose space */
++ .virtual = CMX270_IDE104_VIRT,
++ .pfn = __phys_to_pfn(CMX270_IDE104_PHYS),
++ .length = PXA_CS_SIZE - (8<<20),
++ .type = MT_DEVICE
++ },
++ [1] = { /* PCI bridge */
++ .virtual = CMX270_IT8152_VIRT,
++ .pfn = __phys_to_pfn(CMX270_IT8152_PHYS),
++ .length = PXA_CS_SIZE,
++ .type = MT_DEVICE
++ },
++};
++
++/*
++ Display definitions
++ keep these for backwards compatibility, although symbolic names (as
++ e.g. in lpd270.c) looks better
++ */
++#define MTYPE_STN320x240 0
++#define MTYPE_TFT640x480 1
++#define MTYPE_CRT640x480 2
++#define MTYPE_CRT800x600 3
++#define MTYPE_TFT320x240 6
++#define MTYPE_STN640x480 7
++
++static struct pxafb_mode_info generic_stn_320x240_mode = {
++ .pixclock = 76923,
++ .bpp = 8,
++ .xres = 320,
++ .yres = 240,
++ .hsync_len = 3,
++ .vsync_len = 2,
++ .left_margin = 3,
++ .upper_margin = 0,
++ .right_margin = 3,
++ .lower_margin = 0,
++ .sync = (FB_SYNC_HOR_HIGH_ACT |
++ FB_SYNC_VERT_HIGH_ACT),
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_stn_320x240 = {
++ .modes = &generic_stn_320x240_mode,
++ .num_modes = 1,
++ .lccr0 = 0,
++ .lccr3 = (LCCR3_PixClkDiv(0x03) |
++ LCCR3_Acb(0xff) |
++ LCCR3_PCP),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mode_info generic_tft_640x480_mode = {
++ .pixclock = 38461,
++ .bpp = 8,
++ .xres = 640,
++ .yres = 480,
++ .hsync_len = 60,
++ .vsync_len = 2,
++ .left_margin = 70,
++ .upper_margin = 10,
++ .right_margin = 70,
++ .lower_margin = 5,
++ .sync = 0,
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_tft_640x480 = {
++ .modes = &generic_tft_640x480_mode,
++ .num_modes = 1,
++ .lccr0 = (LCCR0_PAS),
++ .lccr3 = (LCCR3_PixClkDiv(0x01) |
++ LCCR3_Acb(0xff) |
++ LCCR3_PCP),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mode_info generic_crt_640x480_mode = {
++ .pixclock = 38461,
++ .bpp = 8,
++ .xres = 640,
++ .yres = 480,
++ .hsync_len = 63,
++ .vsync_len = 2,
++ .left_margin = 81,
++ .upper_margin = 33,
++ .right_margin = 16,
++ .lower_margin = 10,
++ .sync = (FB_SYNC_HOR_HIGH_ACT |
++ FB_SYNC_VERT_HIGH_ACT),
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_crt_640x480 = {
++ .modes = &generic_crt_640x480_mode,
++ .num_modes = 1,
++ .lccr0 = (LCCR0_PAS),
++ .lccr3 = (LCCR3_PixClkDiv(0x01) |
++ LCCR3_Acb(0xff)),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mode_info generic_crt_800x600_mode = {
++ .pixclock = 28846,
++ .bpp = 8,
++ .xres = 800,
++ .yres = 600,
++ .hsync_len = 63,
++ .vsync_len = 2,
++ .left_margin = 26,
++ .upper_margin = 21,
++ .right_margin = 26,
++ .lower_margin = 11,
++ .sync = (FB_SYNC_HOR_HIGH_ACT |
++ FB_SYNC_VERT_HIGH_ACT),
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_crt_800x600 = {
++ .modes = &generic_crt_800x600_mode,
++ .num_modes = 1,
++ .lccr0 = (LCCR0_PAS),
++ .lccr3 = (LCCR3_PixClkDiv(0x02) |
++ LCCR3_Acb(0xff)),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mode_info generic_tft_320x240_mode = {
++ .pixclock = 134615,
++ .bpp = 16,
++ .xres = 320,
++ .yres = 240,
++ .hsync_len = 63,
++ .vsync_len = 7,
++ .left_margin = 75,
++ .upper_margin = 0,
++ .right_margin = 15,
++ .lower_margin = 15,
++ .sync = 0,
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_tft_320x240 = {
++ .modes = &generic_tft_320x240_mode,
++ .num_modes = 1,
++ .lccr0 = (LCCR0_PAS),
++ .lccr3 = (LCCR3_PixClkDiv(0x06) |
++ LCCR3_Acb(0xff) |
++ LCCR3_PCP),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mode_info generic_stn_640x480_mode = {
++ .pixclock = 57692,
++ .bpp = 8,
++ .xres = 640,
++ .yres = 480,
++ .hsync_len = 4,
++ .vsync_len = 2,
++ .left_margin = 10,
++ .upper_margin = 5,
++ .right_margin = 10,
++ .lower_margin = 5,
++ .sync = (FB_SYNC_HOR_HIGH_ACT |
++ FB_SYNC_VERT_HIGH_ACT),
++ .cmap_greyscale = 0,
++};
++
++static struct pxafb_mach_info generic_stn_640x480 = {
++ .modes = &generic_stn_640x480_mode,
++ .num_modes = 1,
++ .lccr0 = 0,
++ .lccr3 = (LCCR3_PixClkDiv(0x02) |
++ LCCR3_Acb(0xff)),
++ .cmap_inverse = 0,
++ .cmap_static = 0,
++};
++
++static struct pxafb_mach_info *cmx270_display = &generic_crt_640x480;
++
++static int __init cmx270_set_display(char *str)
++{
++ int disp_type = simple_strtol(str, NULL, 0);
++ switch (disp_type) {
++ case MTYPE_STN320x240:
++ cmx270_display = &generic_stn_320x240;
++ break;
++ case MTYPE_TFT640x480:
++ cmx270_display = &generic_tft_640x480;
++ break;
++ case MTYPE_CRT640x480:
++ cmx270_display = &generic_crt_640x480;
++ break;
++ case MTYPE_CRT800x600:
++ cmx270_display = &generic_crt_800x600;
++ break;
++ case MTYPE_TFT320x240:
++ cmx270_display = &generic_tft_320x240;
++ break;
++ case MTYPE_STN640x480:
++ cmx270_display = &generic_stn_640x480;
++ break;
++ default: /* fallback to CRT 640x480 */
++ cmx270_display = &generic_crt_640x480;
++ break;
++ }
++ return 1;
++}
++
++__setup("monitor=", cmx270_set_display);
++
++/* PXA27x OHCI controller setup */
++static int cmx270_ohci_init(struct device *dev)
++{
++ /* Set the Power Control Polarity Low */
++ UHCHR = (UHCHR | UHCHR_PCPL) &
++ ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
++
++ return 0;
++}
++
++static struct pxaohci_platform_data cmx270_ohci_platform_data = {
++ .port_mode = PMM_PERPORT_MODE,
++ .init = cmx270_ohci_init,
++};
++
++
++static int cmx270_mci_init(struct device *dev, irq_handler_t cmx270_detect_int, void *data)
++{
++ int err;
++
++ /*
++ * setup GPIO for PXA27x MMC controller
++ */
++ pxa_gpio_mode(GPIO32_MMCCLK_MD);
++ pxa_gpio_mode(GPIO112_MMCCMD_MD);
++ pxa_gpio_mode(GPIO92_MMCDAT0_MD);
++ pxa_gpio_mode(GPIO109_MMCDAT1_MD);
++ pxa_gpio_mode(GPIO110_MMCDAT2_MD);
++ pxa_gpio_mode(GPIO111_MMCDAT3_MD);
++
++ /* SB-X270 uses GPIO105 as SD power enable */
++ pxa_gpio_mode(105 | GPIO_OUT);
++
++ /* card detect IRQ on GPIO 83 */
++ pxa_gpio_mode(IRQ_TO_GPIO(CMX270_MMC_IRQ));
++ set_irq_type(CMX270_MMC_IRQ, IRQT_FALLING);
++
++ err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int, SA_INTERRUPT,
++ "MMC card detect", data);
++ if (err) {
++ printk(KERN_ERR "cmx270_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
++ return -1;
++ }
++
++ return 0;
++}
++
++static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
++{
++ struct pxamci_platform_data* p_d = dev->platform_data;
++
++ if (( 1 << vdd) & p_d->ocr_mask) {
++ printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
++ GPCR(105) = GPIO_bit(105);
++ } else {
++ GPSR(105) = GPIO_bit(105);
++ printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
++ }
++}
++
++static void cmx270_mci_exit(struct device *dev, void *data)
++{
++ free_irq(CMX270_MMC_IRQ, data);
++}
++
++static struct pxamci_platform_data cmx270_mci_platform_data = {
++ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
++ .init = cmx270_mci_init,
++ .setpower = cmx270_mci_setpower,
++ .exit = cmx270_mci_exit,
++};
++
++#ifdef CONFIG_PM
++/* extern struct subsystem power_subsys; */
++static unsigned long sleep_save_ite[10];
++static unsigned long sleep_save_msc[10];
++
++static int cmx270_suspend(struct sys_device *dev, pm_message_t state)
++{
++#ifdef CONFIG_PCI
++ /* save ITE state */
++ sleep_save_ite[0] = IT8152_INTC_PDCNIMR;
++ sleep_save_ite[1] = IT8152_INTC_LPCNIMR;
++ sleep_save_ite[2] = IT8152_INTC_LPNIAR;
++
++ /* Clear ITE IRQ's */
++ IT8152_INTC_PDCNIRR = 0;
++ IT8152_INTC_LPCNIRR = 0;
++#endif
++
++ /* save MSC registers */
++ sleep_save_msc[0] = MSC0;
++ sleep_save_msc[1] = MSC1;
++ sleep_save_msc[2] = MSC2;
++
++ /* setup power saving mode registers */
++ PCFR = 0x0;
++ PSLR = 0xff400000;
++ PMCR = 0x00000005;
++ PWER = 0x80000000;
++ PFER = 0x00000000;
++ PRER = 0x00000000;
++ PGSR0 = 0xC0018800;
++ PGSR1 = 0x004F0002;
++ PGSR2 = 0x6021C000;
++ PGSR3 = 0x00020000;
++
++ return 0;
++}
++
++static int cmx270_resume(struct sys_device *dev)
++{
++#ifdef CONFIG_PCI
++ /* restore IT8152 state */
++ IT8152_INTC_PDCNIMR = sleep_save_ite[0];
++ IT8152_INTC_LPCNIMR = sleep_save_ite[1];
++ IT8152_INTC_LPNIAR = sleep_save_ite[2];
++#endif
++
++ /* restore MSC registers */
++ MSC0 = sleep_save_msc[0];
++ MSC1 = sleep_save_msc[1];
++ MSC2 = sleep_save_msc[2];
++
++ return 0;
++}
++
++static struct sysdev_class cmx270_pm_sysclass = {
++ set_kset_name("pm"),
++ .resume = cmx270_resume,
++ .suspend = cmx270_suspend,
++};
++
++static struct sys_device cmx270_pm_device = {
++ .cls = &cmx270_pm_sysclass,
++};
++
++static int __init cmx270_pm_init(void)
++{
++ int error;
++ error = sysdev_class_register(&cmx270_pm_sysclass);
++ if (error == 0)
++ error = sysdev_register(&cmx270_pm_device);
++ return error;
++}
++#else
++static int __init cmx270_pm_init(void) { return 0; }
++#endif
++
++static void __init cmx270_init(void)
++{
++ cmx270_pm_init();
++
++ set_pxa_fb_info(cmx270_display);
++
++ /* register CM-X270 platform devices */
++ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
++
++ /* set MCI and OHCI platform parameters */
++ pxa_set_mci_info(&cmx270_mci_platform_data);
++ pxa_set_ohci_info(&cmx270_ohci_platform_data);
++
++ /* This enables the STUART */
++ pxa_gpio_mode(GPIO46_STRXD_MD);
++ pxa_gpio_mode(GPIO47_STTXD_MD);
++
++ /* This enables the BTUART */
++ pxa_gpio_mode(GPIO42_BTRXD_MD);
++ pxa_gpio_mode(GPIO43_BTTXD_MD);
++ pxa_gpio_mode(GPIO44_BTCTS_MD);
++ pxa_gpio_mode(GPIO45_BTRTS_MD);
++}
++
++#ifdef CONFIG_PCI
++static void cmx270_mask_irq(unsigned int irq)
++{
++ switch(irq) {
++ case IT8152_IRQ(0):
++ IT8152_INTC_PDCNIMR |= PCISERR_BIT;
++ break;
++ case IT8152_IRQ(1):
++ IT8152_INTC_PDCNIMR |= H2PTADR_BIT;
++ break;
++ case IT8152_IRQ(2):
++ IT8152_INTC_PDCNIMR |= H2PMAR_BIT;
++ break;
++ case IT8152_IRQ(3):
++ IT8152_INTC_PDCNIMR |= PCI_INTA_BIT;
++ break;
++ case IT8152_IRQ(4):
++ IT8152_INTC_PDCNIMR |= PCI_INTB_BIT;
++ break;
++ case IT8152_IRQ(5):
++ IT8152_INTC_PDCNIMR |= PCI_INTC_BIT;
++ break;
++ case IT8152_IRQ(6):
++ IT8152_INTC_PDCNIMR |= PCI_INTD_BIT;
++ break;
++ case IT8152_IRQ(7):
++ IT8152_INTC_PDCNIMR |= USB_INT_BIT;
++ break;
++ case IT8152_IRQ(9):
++ IT8152_INTC_PDCNIMR |= CDMA_INT_BIT;
++ break;
++ case IT8152_IRQ(10):
++ IT8152_INTC_LDCNIMR |= ITESER_BIT;
++ break;
++ }
++}
++
++static void cmx270_unmask_irq(unsigned int irq)
++{
++ switch(irq) {
++ case IT8152_IRQ(0):
++ IT8152_INTC_PDCNIMR &= (~PCISERR_BIT);
++ break;
++ case IT8152_IRQ(1):
++ IT8152_INTC_PDCNIMR &= (~H2PTADR_BIT);
++ break;
++ case IT8152_IRQ(2):
++ IT8152_INTC_PDCNIMR &= (~H2PMAR_BIT);
++ break;
++ case IT8152_IRQ(3):
++ IT8152_INTC_PDCNIMR &= (~PCI_INTA_BIT);
++ break;
++ case IT8152_IRQ(4):
++ IT8152_INTC_PDCNIMR &= (~PCI_INTB_BIT);
++ break;
++ case IT8152_IRQ(5):
++ IT8152_INTC_PDCNIMR &= (~PCI_INTC_BIT);
++ break;
++ case IT8152_IRQ(6):
++ IT8152_INTC_PDCNIMR &= (~PCI_INTD_BIT);
++ break;
++ case IT8152_IRQ(7):
++ IT8152_INTC_PDCNIMR &= (~USB_INT_BIT);
++ break;
++ case IT8152_IRQ(9):
++ IT8152_INTC_PDCNIMR &= (~CDMA_INT_BIT);
++ break;
++ case IT8152_IRQ(10):
++ IT8152_INTC_LDCNIMR &= (~ITESER_BIT);
++ break;
++ }
++}
++
++static struct irq_chip cmx270_irq_chip = {
++ .ack = cmx270_mask_irq,
++ .mask = cmx270_mask_irq,
++ .unmask = cmx270_unmask_irq,
++};
++#endif
++
++static void __init cmx270_init_irq(void)
++{
++ int irq;
++
++ pxa27x_init_irq();
++
++ IT8152_INTC_PDCNIMR = 0xffff;
++
++#ifdef CONFIG_PCI
++ /* Disable and clear IRQ's for ITE8152 */
++ IT8152_INTC_PDCNIMR = 0xffff;
++ IT8152_INTC_PDCNIRR = 0;
++ IT8152_INTC_LPCNIMR = 0xffff;
++ IT8152_INTC_LPCNIRR = 0;
++ IT8152_INTC_LDCNIMR = 0xffff;
++ IT8152_INTC_LDCNIRR = 0;
++
++ for(irq = IT8152_IRQ(0); irq <= IT8152_IRQ_MAX; irq++) {
++ set_irq_chip(irq, &cmx270_irq_chip);
++ set_irq_handler(irq, handle_level_irq);
++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
++ }
++
++ /* INTC signal from IT8152 is connected to GPIO0 */
++ pxa_gpio_mode(IRQ_GPIO_IT8152_IRQ);
++ set_irq_chained_handler(IRQ_GPIO_IT8152_IRQ, cmx270_irq_demux);
++ set_irq_type(IRQ_GPIO_IT8152_IRQ, IRQT_RISING);
++#endif
++
++ /* Setup interrupt for dm9000 */
++ pxa_gpio_mode(IRQ_TO_GPIO(CMX270_ETHIRQ));
++ set_irq_type(CMX270_ETHIRQ, IRQT_RISING);
++
++ /* Setup interrupt for 2700G */
++ pxa_gpio_mode(IRQ_TO_GPIO(CMX270_GFXIRQ));
++ set_irq_type(CMX270_GFXIRQ, IRQT_FALLING);
++}
++
++static void __init cmx270_map_io(void)
++{
++ pxa_map_io();
++ iotable_init(cmx270_io_desc, ARRAY_SIZE(cmx270_io_desc));
++}
++
++
++MACHINE_START(ARMCORE, "Compulab CM-x270")
++ .boot_params = 0xa0000100,
++ .phys_io = 0x40000000,
++ .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
++ .map_io = cmx270_map_io,
++ .init_irq = cmx270_init_irq,
++ .timer = &pxa_timer,
++ .init_machine = cmx270_init,
++MACHINE_END
+diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
+index 4468cb3..02b04e2 100644
+--- a/drivers/leds/Kconfig
++++ b/drivers/leds/Kconfig
+@@ -87,6 +87,12 @@ config LEDS_H1940
+ help
+ This option enables support for the LEDs on the h1940.
+
++config LEDS_CM_X270
++ tristate "LED Support for the CM-X270 LEDs"
++ depends on LEDS_CLASS && MACH_ARMCORE
++ help
++ This option enables support for the CM-X270 LEDs.
++
+ config LEDS_COBALT
+ tristate "LED Support for Cobalt Server front LED"
+ depends on LEDS_CLASS && MIPS_COBALT
+diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
+index f8995c9..12a860c 100644
+--- a/drivers/leds/Makefile
++++ b/drivers/leds/Makefile
+@@ -17,6 +17,7 @@ obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o
+ obj-$(CONFIG_LEDS_H1940) += leds-h1940.o
+ obj-$(CONFIG_LEDS_COBALT) += leds-cobalt.o
+ obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
++obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
+
+ # LED Triggers
+ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
+diff --git a/drivers/leds/leds-cm-x270.c b/drivers/leds/leds-cm-x270.c
+new file mode 100644
+index 0000000..63b7e9e
+--- /dev/null
++++ b/drivers/leds/leds-cm-x270.c
+@@ -0,0 +1,126 @@
++/*
++ * drivers/leds/leds-cm-x270.c
++ *
++ * Copyright 2007 CompuLab Ltd.
++ * Author: Mike Rapoport <mike@compulab.co.il>
++ *
++ * Based on leds-corgi.c
++ * Author: Richard Purdie <rpurdie@openedhand.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/leds.h>
++
++#include <asm/arch/hardware.h>
++#include <asm/arch/pxa-regs.h>
++
++#define GPIO_RED_LED (93)
++#define GPIO_GREEN_LED (94)
++
++#define CMX270_RED_ON() GPCR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
++#define CMX270_RED_OFF() GPSR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
++#define CMX270_GREEN_ON() GPCR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
++#define CMX270_GREEN_OFF() GPSR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
++
++
++static void cmx270_red_set(struct led_classdev *led_cdev, enum led_brightness value)
++{
++ if (value)
++ CMX270_RED_ON();
++ else
++ CMX270_RED_OFF();
++}
++
++static void cmx270_green_set(struct led_classdev *led_cdev, enum led_brightness value)
++{
++ if (value)
++ CMX270_GREEN_ON();
++ else
++ CMX270_GREEN_OFF();
++}
++
++static struct led_classdev cmx270_red_led = {
++ .name = "cm-x270:red",
++ .default_trigger = "nand-disk",
++ .brightness_set = cmx270_red_set,
++};
++
++static struct led_classdev cmx270_green_led = {
++ .name = "cm-x270:green",
++ .default_trigger = "heartbeat",
++ .brightness_set = cmx270_green_set,
++};
++
++#ifdef CONFIG_PM
++static int cmx270led_suspend(struct platform_device *dev, pm_message_t state)
++{
++ led_classdev_suspend(&cmx270_red_led);
++ led_classdev_suspend(&cmx270_green_led);
++ return 0;
++}
++
++static int cmx270led_resume(struct platform_device *dev)
++{
++ led_classdev_resume(&cmx270_red_led);
++ led_classdev_resume(&cmx270_green_led);
++ return 0;
++}
++#endif
++
++static int cmx270led_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ ret = led_classdev_register(&pdev->dev, &cmx270_red_led);
++ if (ret < 0)
++ return ret;
++
++ ret = led_classdev_register(&pdev->dev, &cmx270_green_led);
++ if (ret < 0)
++ led_classdev_unregister(&cmx270_red_led);
++
++ return ret;
++}
++
++static int cmx270led_remove(struct platform_device *pdev)
++{
++ led_classdev_unregister(&cmx270_red_led);
++ led_classdev_unregister(&cmx270_green_led);
++ return 0;
++}
++
++static struct platform_driver cmx270led_driver = {
++ .probe = cmx270led_probe,
++ .remove = cmx270led_remove,
++#ifdef CONFIG_PM
++ .suspend = cmx270led_suspend,
++ .resume = cmx270led_resume,
++#endif
++ .driver = {
++ .name = "cm-x270-led",
++ },
++};
++
++static int __init cmx270led_init(void)
++{
++ return platform_driver_register(&cmx270led_driver);
++}
++
++static void __exit cmx270led_exit(void)
++{
++ platform_driver_unregister(&cmx270led_driver);
++}
++
++module_init(cmx270led_init);
++module_exit(cmx270led_exit);
++
++MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
++MODULE_DESCRIPTION("Corgi LED driver");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
+index c551925..b34f875 100644
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -940,6 +940,14 @@ config DM9000
+ <file:Documentation/networking/net-modules.txt>. The module will be
+ called dm9000.
+
++config DM9000_NOEPROM
++ bool "DM9000 without EEPROM attached"
++ depends on DM9000
++ ---help---
++ Select this option if you have DM9000 chipset without EEPROM
++ containing the MAC address. In this case MAC address should
++ be set either by the bootloader or using ifconfig
++
+ config SMC911X
+ tristate "SMSC LAN911[5678] support"
+ select CRC32
+diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
+index 738aa59..2371c6b 100644
+--- a/drivers/net/dm9000.c
++++ b/drivers/net/dm9000.c
+@@ -577,6 +577,7 @@ dm9000_probe(struct platform_device *pdev)
+ db->mii.mdio_read = dm9000_phy_read;
+ db->mii.mdio_write = dm9000_phy_write;
+
++#ifndef CONFIG_DM9000_NOEPROM
+ /* Read SROM content */
+ for (i = 0; i < 64; i++)
+ ((u16 *) db->srom)[i] = read_srom_word(db, i);
+@@ -584,6 +585,11 @@ dm9000_probe(struct platform_device *pdev)
+ /* Set Node Address */
+ for (i = 0; i < 6; i++)
+ ndev->dev_addr[i] = db->srom[i];
++#else
++ /* The Node Address was set by bootloader */
++ for (i=0; i<6; i++)
++ ndev->dev_addr[i] = ior(db, 0x10+i);
++#endif
+
+ if (!is_valid_ether_addr(ndev->dev_addr)) {
+ /* try reading from mac */
+diff --git a/include/asm-arm/arch-pxa/cm-x270.h b/include/asm-arm/arch-pxa/cm-x270.h
+new file mode 100644
+index 0000000..24613a5
+--- /dev/null
++++ b/include/asm-arm/arch-pxa/cm-x270.h
+@@ -0,0 +1,71 @@
++/*
++ * linux/include/asm/arch-pxa/armcore.h
++ *
++ * Compulab Ltd., 2003
++ *
++ * ARMCore registers
++ */
++
++
++#define CMX270_CS1_PHYS (PXA_CS1_PHYS)
++#define MARATHON_PHYS (PXA_CS2_PHYS)
++#define CMX270_IDE104_PHYS (PXA_CS3_PHYS)
++#define CMX270_IT8152_PHYS (PXA_CS4_PHYS)
++
++#define PXA_CS_SIZE (64*1024*1024)
++
++/* Virtual map */
++
++#define CMX270_VIRT_BASE (0xe8000000)
++
++#define CMX270_IT8152_VIRT (CMX270_VIRT_BASE)
++#define CMX270_IDE104_VIRT (CMX270_IT8152_VIRT + PXA_CS_SIZE)
++
++
++/* GPIO related definitions */
++#define GPIO_IT8152_IRQ (22)
++#define GPIO_RED_LED (93)
++#define GPIO_GREEN_LED (94)
++
++
++#define IRQ_GPIO_IT8152_IRQ IRQ_GPIO(GPIO_IT8152_IRQ)
++#define PME_IRQ IRQ_GPIO(0)
++#define CMX270_IDE_IRQ IRQ_GPIO(100)
++#define CMX270_GPIRQ1 IRQ_GPIO(101)
++#define CMX270_TOUCHIRQ IRQ_GPIO(96)
++#define CMX270_ETHIRQ IRQ_GPIO(10)
++#define CMX270_GFXIRQ IRQ_GPIO(95)
++#define CMX270_NANDIRQ IRQ_GPIO(89)
++#define CMX270_MMC_IRQ IRQ_GPIO(83)
++
++/* LED macros */
++#define CMX270_RED_ON() GPCR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
++#define CMX270_RED_OFF() GPSR(GPIO_RED_LED) = GPIO_bit(GPIO_RED_LED)
++#define CMX270_GREEN_ON() GPCR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
++#define CMX270_GREEN_OFF() GPSR(GPIO_GREEN_LED) = GPIO_bit(GPIO_GREEN_LED)
++
++/* PCMCIA related definitions */
++#define PCC_DETECT(x) (GPLR(84 - (x)) & GPIO_bit(84 - (x)))
++#define PCC_READY(x) (GPLR(82 - (x)) & GPIO_bit(81 - (x)))
++
++#define PCMCIA_S0_CD_VALID IRQ_GPIO(84)
++#define PCMCIA_S0_CD_VALID_EDGE GPIO_BOTH_EDGES
++
++#define PCMCIA_S1_CD_VALID IRQ_GPIO(83)
++#define PCMCIA_S1_CD_VALID_EDGE GPIO_BOTH_EDGES
++
++#define PCMCIA_S0_RDYINT IRQ_GPIO(82)
++#define PCMCIA_S1_RDYINT IRQ_GPIO(81)
++
++#define PCMCIA_RESET_GPIO 53
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
+index 3861217..beb240e 100644
+--- a/include/asm-arm/arch-pxa/hardware.h
++++ b/include/asm-arm/arch-pxa/hardware.h
+@@ -126,4 +126,15 @@ extern unsigned int get_lcdclk_frequency_10khz(void);
+
+ #endif
+
++#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
++#define HAVE_ARCH_PCI_SET_DMA_MASK
++#ifndef __ASSEMBLY__
++extern unsigned long armcore_pcibios_min_io;
++extern unsigned long armcore_pcibios_min_mem;
++#endif
++#define PCIBIOS_MIN_IO (armcore_pcibios_min_io)
++#define PCIBIOS_MIN_MEM (armcore_pcibios_min_mem)
++#define pcibios_assign_all_busses() 1
++#endif
++
+ #endif /* _ASM_ARCH_HARDWARE_H */
+diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
+index a07fe0f..efb3d42 100644
+--- a/include/asm-arm/arch-pxa/irqs.h
++++ b/include/asm-arm/arch-pxa/irqs.h
+@@ -216,3 +216,23 @@
+ #define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
+ #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
+ #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
++
++/* ITE8152 irqs on CM-x2xx */
++#ifdef CONFIG_MACH_ARMCORE
++#define IT8152_IRQ(x) (IRQ_BOARD_START + (x))
++#define PCISERR IT8152_IRQ(0)
++#define H2PTADR IT8152_IRQ(1)
++#define H2PMAR IT8152_IRQ(2)
++#define PCI_INTA IT8152_IRQ(3)
++#define PCI_INTB IT8152_IRQ(4)
++#define PCI_INTC IT8152_IRQ(5)
++#define PCI_INTD IT8152_IRQ(6)
++#define USB_INT IT8152_IRQ(7)
++#define AUDIO_INT IT8152_IRQ(8)
++#define CDMA_INT IT8152_IRQ(9)
++#define IRQ_ITESER IT8152_IRQ(10)
++#define IT8152_IRQ_MAX IT8152_IRQ(10)
++
++#undef NR_IRQS
++#define NR_IRQS IT8152_IRQ_MAX+1
++#endif
+diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
+index d9bfb39..83db3cb 100644
+--- a/include/asm-arm/memory.h
++++ b/include/asm-arm/memory.h
+@@ -141,6 +141,16 @@
+ * allocations. This must be the smallest DMA mask in the system,
+ * so a successful GFP_DMA allocation will always satisfy this.
+ */
++
++#ifdef CONFIG_PCI_HOST_ITE8152
++void it8152_adjust_zones(int node, unsigned long *size, unsigned long *holes);
++
++#define arch_adjust_zones(node, size, holes) \
++ it8152_adjust_zones(node, size, holes)
++
++#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
++#endif
++
+ #ifndef ISA_DMA_THRESHOLD
+ #define ISA_DMA_THRESHOLD (0xffffffffULL)
+ #endif
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0002-cm-x270-match-type.patch b/packages/linux/linux-2.6.23/cm-x270/0002-cm-x270-match-type.patch
new file mode 100644
index 0000000000..981cef9207
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0002-cm-x270-match-type.patch
@@ -0,0 +1,25 @@
+From d4e9090a5ff36090402d0c336804f061f391f5de Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 18:58:27 -0400
+Subject: [PATCH] cm-x270-match-type
+
+---
+ arch/arm/boot/compressed/head-xscale.S | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
+index 236bbe5..7ae9de1 100644
+--- a/arch/arm/boot/compressed/head-xscale.S
++++ b/arch/arm/boot/compressed/head-xscale.S
+@@ -48,3 +48,8 @@ __XScale_start:
+ str r1, [r0, #0x18]
+ #endif
+
++#if defined(CONFIG_MACH_ARMCORE)
++ mov r7, #(MACH_TYPE_ARMCORE & 0xFF00)
++ add r7, r7, #(MACH_TYPE_ARMCORE & 0xFF)
++#endif
++
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0003-cm-x270-ide.patch b/packages/linux/linux-2.6.23/cm-x270/0003-cm-x270-ide.patch
new file mode 100644
index 0000000000..5c5c39499c
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0003-cm-x270-ide.patch
@@ -0,0 +1,186 @@
+From c07ab3ce1c18437c480c3cec96da210434629c74 Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 18:59:39 -0400
+Subject: [PATCH] cm-x270-ide
+
+---
+ drivers/ide/Kconfig | 8 +++
+ drivers/ide/arm/Makefile | 1 +
+ drivers/ide/arm/cm-x270-ide.c | 135 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 144 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/ide/arm/cm-x270-ide.c
+
+diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
+index 4200251..ab3a29e 100644
+--- a/drivers/ide/Kconfig
++++ b/drivers/ide/Kconfig
+@@ -866,6 +866,14 @@ config BLK_DEV_IDE_BAST
+ Say Y here if you want to support the onboard IDE channels on the
+ Simtec BAST or the Thorcom VR1000
+
++config BLK_DEV_IDE_CM_X270
++ tristate "CompuLab CM-X270 IDE support"
++ depends on ARM && (MACH_ARMCORE)
++ help
++ Say Y here if you want to support the onboard IDE channels on the
++ CompuLab CM-X270 module
++
++
+ config BLK_DEV_GAYLE
+ bool "Amiga Gayle IDE interface support"
+ depends on AMIGA
+diff --git a/drivers/ide/arm/Makefile b/drivers/ide/arm/Makefile
+index 6a78f07..e5cadb7 100644
+--- a/drivers/ide/arm/Makefile
++++ b/drivers/ide/arm/Makefile
+@@ -2,5 +2,6 @@
+ obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
+ obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
+ obj-$(CONFIG_BLK_DEV_IDE_BAST) += bast-ide.o
++obj-$(CONFIG_BLK_DEV_IDE_CM_X270) += cm-x270-ide.o
+
+ EXTRA_CFLAGS := -Idrivers/ide
+diff --git a/drivers/ide/arm/cm-x270-ide.c b/drivers/ide/arm/cm-x270-ide.c
+new file mode 100644
+index 0000000..a8b15aa
+--- /dev/null
++++ b/drivers/ide/arm/cm-x270-ide.c
+@@ -0,0 +1,135 @@
++/* linux/drivers/ide/arm/cm-x270-ide.c
++ *
++ * Copyright (c) 2006 CompuLab, Ltd
++ * Mike Rapoport <mike@compulab.co.il>
++ *
++ * Based on linux/drivers/ide/arm/bast-ide.c
++ * Copyright (c) 2003-2004 Simtec Electronics
++ * Ben Dooks <ben@simtec.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/errno.h>
++#include <linux/ide.h>
++#include <linux/init.h>
++#include <linux/irq.h>
++
++#include <asm/mach-types.h>
++
++#include <asm/io.h>
++#include <asm/arch/pxa-regs.h>
++#include <asm/arch/cm-x270.h>
++
++#define CMX270_SB270_IDECS0_VIRT (CMX270_IDE104_VIRT + (1<<24) + (1<<25))
++#define CMX270_SB270_IDECS1_VIRT (CMX270_IDE104_VIRT + (1<<25))
++#define CMX270_ATX_IDECS0_VIRT (CMX270_IDE104_VIRT + (1<<25))
++#define CMX270_ATX_IDECS1_VIRT (CMX270_IDE104_VIRT + (1<<25) + (1<<22))
++
++/* list of registered interfaces */
++static ide_hwif_t *ifs[1];
++
++static int __init
++cmx270_ide_register(unsigned int base, unsigned int aux, int irq,
++ ide_hwif_t **hwif)
++{
++ hw_regs_t hw;
++
++ memset(&hw, 0, sizeof(hw));
++
++ if(!base || !aux) return -EINVAL;
++
++ printk(KERN_DEBUG "%s: base = %08x, aux = %08x\n", __FUNCTION__,
++ base, aux);
++
++ /* Different mappings for local bus IDE and PCMCIA IDE */
++ if(base == CMX270_SB270_IDECS0_VIRT) {
++ hw.io_ports[IDE_DATA_OFFSET] = base + 0;
++ hw.io_ports[IDE_ERROR_OFFSET] = base + (0x1<<3);
++ hw.io_ports[IDE_NSECTOR_OFFSET]= base + (0x2<<3);
++ hw.io_ports[IDE_SECTOR_OFFSET]= base + (0x3<<3);
++ hw.io_ports[IDE_LCYL_OFFSET]= base + (0x4<<3);
++ hw.io_ports[IDE_HCYL_OFFSET]= base + (0x5<<3);
++ hw.io_ports[IDE_SELECT_OFFSET]= base + (0x6<<3);
++ hw.io_ports[IDE_STATUS_OFFSET]= base + (0x7<<3);
++ hw.io_ports[IDE_CONTROL_OFFSET] = aux+(0x6<<3);
++ }
++ else if (base == CMX270_ATX_IDECS0_VIRT) { /* atx base */
++ hw.io_ports[IDE_DATA_OFFSET] = base + 0;
++ hw.io_ports[IDE_ERROR_OFFSET] = base + 8;
++ hw.io_ports[IDE_NSECTOR_OFFSET]= base + 2;
++ hw.io_ports[IDE_SECTOR_OFFSET]= base + 10;
++ hw.io_ports[IDE_LCYL_OFFSET]= base + 4;
++ hw.io_ports[IDE_HCYL_OFFSET]= base + 12;
++ hw.io_ports[IDE_SELECT_OFFSET]= base + 6; //6;
++ hw.io_ports[IDE_STATUS_OFFSET]= base + 14;
++ hw.io_ports[IDE_CONTROL_OFFSET] = (aux+0x6);
++ } else {
++ printk(KERN_DEBUG "%s: registering wrong IDE i/f\n", __FUNCTION__);
++ hw.io_ports[IDE_DATA_OFFSET] = base + 8;
++ hw.io_ports[IDE_ERROR_OFFSET] = base + 13;
++ hw.io_ports[IDE_NSECTOR_OFFSET] = base + 2;
++ hw.io_ports[IDE_SECTOR_OFFSET] = base + 3;
++ hw.io_ports[IDE_LCYL_OFFSET] = base + 4;
++ hw.io_ports[IDE_HCYL_OFFSET] = base + 5;
++ hw.io_ports[IDE_SELECT_OFFSET] = base + 6;
++ hw.io_ports[IDE_STATUS_OFFSET] = base + 7;
++ hw.io_ports[IDE_CONTROL_OFFSET] = aux;
++ }
++
++ hw.irq = irq;
++
++ return ide_register_hw(&hw, hwif);
++}
++
++static int __init cmx270_ide_init(void)
++{
++ int retval = 0;
++
++ if (!(machine_is_armcore()))
++ goto out;
++
++ printk("CM-X270: initializing IDE interface\n");
++
++ MSC1 = 0x7ffc7ff4;
++
++ /* Interrupts on rising edge: lines are inverted before they get to
++ the PXA */
++ pxa_gpio_mode(IRQ_TO_GPIO(CMX270_IDE_IRQ));
++
++ /* try SB-X270 */
++ set_irq_type(CMX270_IDE_IRQ, IRQ_TYPE_EDGE_RISING);
++ retval = cmx270_ide_register(CMX270_SB270_IDECS0_VIRT,
++ CMX270_SB270_IDECS1_VIRT,
++ CMX270_IDE_IRQ, &ifs[0]);
++ if (retval >= 0) {
++ printk(KERN_DEBUG "%s: found IDE interface on SB-X270\n",
++ __FUNCTION__);
++ goto out;
++ }
++
++ /* SB-X270 detection failed, try ATX */
++ set_irq_type(CMX270_IDE_IRQ, IRQ_TYPE_EDGE_FALLING);
++ retval = cmx270_ide_register(CMX270_ATX_IDECS0_VIRT,
++ CMX270_ATX_IDECS1_VIRT,
++ CMX270_IDE_IRQ, &ifs[0]);
++
++ if ( retval >= 0 ) {
++ printk(KERN_DEBUG "%s: found IDE interface on ATX\n",
++ __FUNCTION__);
++ goto out;
++ }
++
++ out:
++ return retval;
++}
++
++module_init(cmx270_ide_init);
++
++MODULE_AUTHOR("CompuLab");
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION("CompuLab CM-X270 IDE driver");
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0004-cm-x270-it8152.patch b/packages/linux/linux-2.6.23/cm-x270/0004-cm-x270-it8152.patch
new file mode 100644
index 0000000000..8235c2948f
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0004-cm-x270-it8152.patch
@@ -0,0 +1,496 @@
+From 09963a3271b9da8e937e64774fe81454b35d31fd Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 19:00:07 -0400
+Subject: [PATCH] cm-x270-it8152
+
+---
+ arch/arm/common/Makefile | 1 +
+ arch/arm/common/it8152.c | 272 +++++++++++++++++++++++++++++++++++++
+ arch/arm/kernel/bios32.c | 28 ++++-
+ include/asm-arm/hardware/it8152.h | 104 ++++++++++++++
+ include/asm-arm/pci.h | 7 +
+ include/linux/pci_ids.h | 1 +
+ 6 files changed, 410 insertions(+), 3 deletions(-)
+ create mode 100644 arch/arm/common/it8152.c
+ create mode 100644 include/asm-arm/hardware/it8152.h
+
+diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
+index e1289a2..3d0b9fa 100644
+--- a/arch/arm/common/Makefile
++++ b/arch/arm/common/Makefile
+@@ -17,3 +17,4 @@ obj-$(CONFIG_SHARPSL_PM) += sharpsl_pm.o
+ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
+ obj-$(CONFIG_ARCH_IXP2000) += uengine.o
+ obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
++obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
+diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
+new file mode 100644
+index 0000000..8563610
+--- /dev/null
++++ b/arch/arm/common/it8152.c
+@@ -0,0 +1,272 @@
++/*
++ * arch/arm/common/it8152.c: PCI functions for IT8152
++ *
++ * Compulab Ltd, 2002-2006
++ *
++ * The DMA bouncing is taken from arch/arm/mach-ixp4xx/common-pci.c
++ * (see this file for respective copyrights)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/sched.h>
++#include <linux/kernel.h>
++#include <linux/pci.h>
++#include <linux/ptrace.h>
++#include <linux/interrupt.h>
++#include <linux/mm.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++#include <linux/ioport.h>
++#include <asm/mach/map.h>
++
++
++#include <asm/io.h>
++#include <asm/irq.h>
++#include <asm/system.h>
++#include <asm/mach/pci.h>
++#include <asm/hardware/it8152.h>
++
++#define MAX_SLOTS 21
++
++static unsigned long
++it8152_pci_dev_base_address(struct pci_bus *bus, unsigned int devfn)
++{
++ unsigned long addr = 0;
++
++ if (bus->number == 0) {
++ if (devfn < PCI_DEVFN(MAX_SLOTS, 0))
++ addr = (devfn << 8);
++ } else
++ addr = (bus->number << 16) | (devfn << 8);
++
++ return addr;
++}
++
++static int
++it8152_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where,
++ int size, u32 *value)
++{
++ unsigned long addr = it8152_pci_dev_base_address(bus, devfn);
++ u32 v;
++ int shift;
++
++#ifdef CONFIG_MACH_ARMCORE
++ if(devfn!=0) IT8152_GPIO_GPLR=0x00;
++#endif
++ shift = (where & 3);
++
++ IT8152_PCI_CFG_ADDR = (addr + where);
++ v = (IT8152_PCI_CFG_DATA >> (8 * (shift)));
++
++ *value = v;
++
++#ifdef CONFIG_MACH_ARMCORE
++ if(devfn!=0) IT8152_GPIO_GPLR=0x20;
++#endif
++
++ return PCIBIOS_SUCCESSFUL;
++}
++
++
++static int
++it8152_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where,
++ int size, u32 value)
++{
++ unsigned long addr = it8152_pci_dev_base_address(bus, devfn);
++ u32 v, vtemp, mask=0;
++ int shift;
++
++#ifdef CONFIG_MACH_ARMCORE
++ if(devfn!=0) IT8152_GPIO_GPLR=0x00;
++#endif
++
++ if(size==1) mask=0xff;
++ if(size==2) mask=0xffff;
++
++ shift = (where & 3);
++
++ IT8152_PCI_CFG_ADDR = addr + where;
++ vtemp = IT8152_PCI_CFG_DATA;
++
++ if(mask) vtemp &= ~(mask << (8 * shift));
++ else vtemp = 0;
++
++ v = (value << (8 * shift));
++ IT8152_PCI_CFG_ADDR = addr + where;
++ IT8152_PCI_CFG_DATA = (v | vtemp);
++
++#ifdef CONFIG_MACH_ARMCORE
++ if(devfn!=0) IT8152_GPIO_GPLR=0x20;
++#endif
++
++ return PCIBIOS_SUCCESSFUL;
++}
++
++static struct pci_ops it8152_ops = {
++ .read = it8152_pci_read_config,
++ .write = it8152_pci_write_config,
++};
++
++static struct resource it8152_io = {
++ .name = "IT8152 PCI I/O region",
++ .flags = IORESOURCE_IO,
++};
++
++static struct resource it8152_mem1 = {
++ .name = "First IT8152 PCI memory region",
++ .start = 0x10000000,
++ .end = 0x13e00000,
++ .flags = IORESOURCE_MEM,
++};
++
++/*
++ * The following functions are needed for DMA bouncing.
++ * ITE8152 chip can addrees up to 64MByte, so all the devices
++ * connected to ITE8152 (PCI and USB) should have limited DMA window
++ */
++
++/*
++ * Setup DMA mask to 64MB on devices connected to ITE8152. Ignore all
++ * other devices.
++ */
++static int it8152_pci_platform_notify(struct device *dev)
++{
++ if ( dev->bus == &pci_bus_type ) {
++ if ( dev->dma_mask )
++ *dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
++ dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
++ dmabounce_register_dev(dev, 2048, 4096);
++ }
++ return 0;
++}
++
++static int it8152_pci_platform_notify_remove(struct device *dev)
++{
++ if ( dev->bus == &pci_bus_type ) {
++ dmabounce_unregister_dev(dev);
++ }
++ return 0;
++}
++
++int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
++{
++ dev_dbg(dev, "%s: dma_addr %08x, size %08x\n",
++ __FUNCTION__, dma_addr, size);
++ return (dev->bus == &pci_bus_type ) &&
++ ((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
++}
++
++/*
++ * Only first 64MB of memory can be accessed via PCI.
++ * We use GFP_DMA to allocate safe buffers to do map/unmap.
++ * This is really ugly and we need a better way of specifying
++ * DMA-capable regions of memory.
++ */
++void __init it8152_adjust_zones(int node, unsigned long *zone_size,
++ unsigned long *zhole_size)
++{
++ unsigned int sz = SZ_64M >> PAGE_SHIFT;
++
++ /*
++ * Only adjust if > 64M on current system
++ */
++ if (node || (zone_size[0] <= sz))
++ return;
++
++ zone_size[1] = zone_size[0] - sz;
++ zone_size[0] = sz;
++ zhole_size[1] = zhole_size[0];
++ zhole_size[0] = 0;
++}
++
++/*
++ * We override these so we properly do dmabounce otherwise drivers
++ * are able to set the dma_mask to 0xffffffff and we can no longer
++ * trap bounces. :(
++ *
++ * We just return true on everyhing except for < 64MB in which case
++ * we will fail miseralby and die since we can't handle that case.
++ */
++int
++pci_set_dma_mask(struct pci_dev *dev, u64 mask)
++{
++ printk(KERN_INFO "===> %s: %s %x\n", __FUNCTION__, dev->dev.bus_id, mask);
++ if (mask >= PHYS_OFFSET + SZ_64M - 1 )
++ return 0;
++
++ return -EIO;
++}
++
++int
++pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
++{
++ printk(KERN_INFO "===> %s: %s %x\n", __FUNCTION__, dev->dev.bus_id, mask);
++ if (mask >= PHYS_OFFSET + SZ_64M - 1 )
++ return 0;
++
++ return -EIO;
++}
++
++EXPORT_SYMBOL(pci_set_dma_mask);
++EXPORT_SYMBOL(pci_set_consistent_dma_mask);
++
++
++int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
++{
++ it8152_io.start = IT8152_IO_BASE + 0x12000;
++ it8152_io.end = IT8152_IO_BASE + 0x100000;
++
++ if (request_resource(&ioport_resource, &it8152_io)) {
++ printk(KERN_ERR "PCI: unable to allocate IO region\n");
++ return -EBUSY;
++ }
++ if (request_resource(&iomem_resource, &it8152_mem1)) {
++ printk(KERN_ERR "PCI: unable to allocate memory region\n");
++ return -EBUSY;
++ }
++
++ sys->resource[0] = &it8152_io;
++ sys->resource[1] = &it8152_mem1;
++
++ if (platform_notify || platform_notify_remove) {
++ printk(KERN_ERR "PCI: Can't use platform_notify\n");
++ return -EBUSY;
++ }
++
++ platform_notify = it8152_pci_platform_notify;
++ platform_notify_remove = it8152_pci_platform_notify_remove;
++
++ return 1;
++}
++
++/*
++ * If we set up a device for bus mastering, we need to check the latency
++ * timer as we don't have even crappy BIOSes to set it properly.
++ * The implementation is from arch/i386/pci/i386.c
++ */
++unsigned int pcibios_max_latency = 255;
++
++void pcibios_set_master(struct pci_dev *dev)
++{
++ u8 lat;
++
++ pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
++ if (lat < 16)
++ lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
++ else if (lat > pcibios_max_latency)
++ lat = pcibios_max_latency;
++ else
++ return;
++ printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat);
++ pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
++}
++
++
++struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys)
++{
++ return pci_scan_bus(nr, &it8152_ops, sys);
++}
++
+diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
+index a2dd930..4dc5de4 100644
+--- a/arch/arm/kernel/bios32.c
++++ b/arch/arm/kernel/bios32.c
+@@ -279,6 +279,25 @@ static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)
+ }
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);
+
++static void __init pci_fixup_it8152(struct pci_dev *dev)
++{
++ int i;
++ /* fixup for ITE 8152 devices */
++ /* FIXME: add defines for class 0x68000 and 0x80103 */
++ if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
++ dev->class == 0x68000 ||
++ dev->class == 0x80103) {
++ for (i = 0; i < PCI_NUM_RESOURCES; i++) {
++ dev->resource[i].start = 0;
++ dev->resource[i].end = 0;
++ dev->resource[i].flags = 0;
++ }
++ }
++}
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152);
++
++
++
+ void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
+ {
+ if (debug_pci)
+@@ -292,9 +311,12 @@ void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
+ */
+ static inline int pdev_bad_for_parity(struct pci_dev *dev)
+ {
+- return (dev->vendor == PCI_VENDOR_ID_INTERG &&
+- (dev->device == PCI_DEVICE_ID_INTERG_2000 ||
+- dev->device == PCI_DEVICE_ID_INTERG_2010));
++ return ((dev->vendor == PCI_VENDOR_ID_INTERG &&
++ (dev->device == PCI_DEVICE_ID_INTERG_2000 ||
++ dev->device == PCI_DEVICE_ID_INTERG_2010)) ||
++ (dev->vendor == PCI_VENDOR_ID_ITE &&
++ dev->device == PCI_DEVICE_ID_ITE_8152));
++
+ }
+
+ /*
+diff --git a/include/asm-arm/hardware/it8152.h b/include/asm-arm/hardware/it8152.h
+new file mode 100644
+index 0000000..d28210d
+--- /dev/null
++++ b/include/asm-arm/hardware/it8152.h
+@@ -0,0 +1,104 @@
++/*
++ * arch/arm/mach-pxa/it8152.h
++ *
++ * Compulab Ltd., 2006
++ *
++ * ITE 8152 companion chip definitions
++ */
++
++
++/* #define CMX270_IT8152_VIRT (CMX270_VIRT_BASE) */
++
++
++extern unsigned long it8152_base_address;
++
++#define IT8152_IO_BASE (it8152_base_address + 0x03e00000)
++#define IT8152_CFGREG_BASE (it8152_base_address + 0x03f00000)
++
++/* #define IRQ_GPIO_IT8152_IRQ IRQ_GPIO(GPIO_IT8152_IRQ) */
++
++#define IT8152_SHORT_IO(x) (*((volatile unsigned short *)(IT8152_CFGREG_BASE+(x))))
++#define IT8152_LONG_IO(x) (*((volatile unsigned long *)(IT8152_CFGREG_BASE+(x))))
++
++
++#define IT8152_PCI_MEMBASE (*((volatile unsigned long *)(it8152_base_address)))
++/* #define IT8152_PCI_IOBASE (*((volatile unsigned long *)(it8152_base_address + 0x3e00000))) */
++
++#define IT8152_PCI_IACK (*((volatile unsigned long *)(it8152_base_address + 0x3f00808)))
++#define IT8152_PCI_CFG_ADDR (*((volatile unsigned long *)(it8152_base_address + 0x3f00800)))
++#define IT8152_PCI_CFG_DATA (*((volatile unsigned long *)(it8152_base_address + 0x3f00804)))
++
++#define IT_BUSNUM_SHF 16
++#define IT_DEVNUM_SHF 11
++#define IT_FUNCNUM_SHF 8
++#define IT_REGNUM_SHF 2
++
++/* Power management & PLL registers */
++#define IT8152_PMPLL_DSR IT8152_LONG_IO(0x00)
++#define IT8152_PMPLL_DSSR IT8152_LONG_IO(0x04)
++#define IT8152_PMPLL_PLLCR IT8152_LONG_IO(0x20)
++#define IT8152_PMPLL_MFSR IT8152_LONG_IO(0x24)
++
++/* Memory controller */
++#define IT8152_MC_REG_OFFSET 0x100
++
++#define IT8152_MC_SDCR IT8152_LONG_IO(IT8152_MC_REG_OFFSET + 0x00)
++#define IT8152_MC_PCICR IT8152_LONG_IO(IT8152_MC_REG_OFFSET + 0x04)
++
++/* Interrupt related definitions */
++#define IT8152_INTC_REG_OFFSET 0x300
++
++#define IT8152_INTC_LDCNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x00)
++#define IT8152_INTC_LDPNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x04)
++#define IT8152_INTC_LDCNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x08)
++#define IT8152_INTC_LDPNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x0C)
++#define IT8152_INTC_LDNITR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x10)
++#define IT8152_INTC_LDNIAR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x14)
++#define IT8152_INTC_LPCNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x20)
++#define IT8152_INTC_LPPNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x24)
++#define IT8152_INTC_LPCNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x28)
++#define IT8152_INTC_LPPNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x2C)
++#define IT8152_INTC_LPNITR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x30)
++#define IT8152_INTC_LPNIAR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x34)
++#define IT8152_INTC_PDCNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x40)
++#define IT8152_INTC_PDPNIRR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x44)
++#define IT8152_INTC_PDCNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x48)
++#define IT8152_INTC_PDPNIMR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x4C)
++#define IT8152_INTC_PDNITR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x50)
++#define IT8152_INTC_PDNIAR IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0x54)
++#define IT8152_INTC_INTC_TYPER IT8152_LONG_IO(IT8152_INTC_REG_OFFSET + 0xFC)
++
++#define IT8152_UART_BASE IT8152_LONG_IO(0x200)
++
++#define IT8152_GPIO_REG_OFFSET 0x500
++
++#define IT8152_GPIO_GPLR IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET)
++#define IT8152_GPIO_GPCR12 IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET + 0x04)
++#define IT8152_GPIO_GPCR34 IT8152_LONG_IO(IT8152_GPIO_REG_OFFSET + 0x08)
++
++
++/* Interrupt bit definitions */
++#define PCISERR_BIT (1<<14)
++#define H2PTADR_BIT (1<<13)
++#define H2PMAR_BIT (1<<12)
++#define PCI_INTD_BIT (1<<11)
++#define PCI_INTC_BIT (1<<10)
++#define PCI_INTB_BIT (1<<9)
++#define PCI_INTA_BIT (1<<8)
++#define CDMA_INT_BIT (1<<2)
++#define USB_INT_BIT (1<<1)
++#define AUDIO_INT_BIT (1<<0)
++
++/* IT8152 UART */
++#define ITESER_BIT (1<<5)
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
+index ed3f898..75feb15 100644
+--- a/include/asm-arm/pci.h
++++ b/include/asm-arm/pci.h
+@@ -8,10 +8,17 @@
+
+ #define pcibios_scan_all_fns(a, b) 0
+
++#ifdef CONFIG_PCI_HOST_ITE8152
++/* ITE bridge requires setting latency timer to avoid early bus access
++ termination by PIC bus mater devices
++*/
++extern void pcibios_set_master(struct pci_dev *dev);
++#else
+ static inline void pcibios_set_master(struct pci_dev *dev)
+ {
+ /* No special bus mastering setup handling */
+ }
++#endif
+
+ static inline void pcibios_penalize_isa_irq(int irq, int active)
+ {
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
+index 55f307f..357390d 100644
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -1629,6 +1629,7 @@
+ #define PCI_DEVICE_ID_ITE_8211 0x8211
+ #define PCI_DEVICE_ID_ITE_8212 0x8212
+ #define PCI_DEVICE_ID_ITE_8213 0x8213
++#define PCI_DEVICE_ID_ITE_8152 0x8152
+ #define PCI_DEVICE_ID_ITE_8872 0x8872
+ #define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
+
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch b/packages/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch
new file mode 100644
index 0000000000..e1653063fd
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0005-cm-x270-pcmcia.patch
@@ -0,0 +1,228 @@
+From 3066303d1e7d8e847de2e46cf3ed04a103715e17 Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 19:01:27 -0400
+Subject: [PATCH] cm-x270-pcmcia
+
+---
+ drivers/pcmcia/Makefile | 1 +
+ drivers/pcmcia/pxa2xx_cm_x270.c | 198 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 199 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/pcmcia/pxa2xx_cm_x270.c
+
+diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
+index 4276965..353d5b7 100644
+--- a/drivers/pcmcia/Makefile
++++ b/drivers/pcmcia/Makefile
+@@ -69,4 +69,5 @@ sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o
+ pxa2xx_cs-$(CONFIG_ARCH_LUBBOCK) += pxa2xx_lubbock.o sa1111_generic.o
+ pxa2xx_cs-$(CONFIG_MACH_MAINSTONE) += pxa2xx_mainstone.o
+ pxa2xx_cs-$(CONFIG_PXA_SHARPSL) += pxa2xx_sharpsl.o
++pxa2xx_cs-$(CONFIG_MACH_ARMCORE) += pxa2xx_cm_x270.o
+
+diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
+new file mode 100644
+index 0000000..25e369f
+--- /dev/null
++++ b/drivers/pcmcia/pxa2xx_cm_x270.c
+@@ -0,0 +1,198 @@
++/*
++ * linux/drivers/pcmcia/pxa/pxa_armcore.c
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * Compulab Ltd., 2003
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/platform_device.h>
++#include <linux/irq.h>
++
++#include <pcmcia/ss.h>
++#include <asm/delay.h>
++#include <asm/hardware.h>
++
++#include <asm/arch/pxa-regs.h>
++#include <asm/arch/cm-x270.h>
++
++#include "soc_common.h"
++
++
++static struct pcmcia_irqs irqs[] = {
++ { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" },
++ { 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" },
++};
++
++
++static int
++cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
++{
++ int return_val=0;
++
++ GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
++ GPIO_bit(GPIO49_nPWE) |
++ GPIO_bit(GPIO50_nPIOR) |
++ GPIO_bit(GPIO51_nPIOW) |
++ GPIO_bit(GPIO85_nPCE_1) |
++ GPIO_bit(GPIO54_nPCE_2);
++
++ pxa_gpio_mode(GPIO48_nPOE_MD);
++ pxa_gpio_mode(GPIO49_nPWE_MD);
++ pxa_gpio_mode(GPIO50_nPIOR_MD);
++ pxa_gpio_mode(GPIO51_nPIOW_MD);
++ pxa_gpio_mode(GPIO85_nPCE_1_MD);
++ pxa_gpio_mode(GPIO54_nPCE_2_MD);
++ //pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets (on ATX base not routed)*/
++ pxa_gpio_mode(GPIO55_nPREG_MD);
++ pxa_gpio_mode(GPIO56_nPWAIT_MD);
++ pxa_gpio_mode(GPIO57_nIOIS16_MD);
++
++ // Reset signal
++ GPDR(GPIO53_nPCE_2) |= GPIO_bit(GPIO53_nPCE_2);
++ GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
++
++ GPDR(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID));
++ GPDR(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID));
++
++ set_irq_type(PCMCIA_S0_CD_VALID, IRQ_TYPE_EDGE_BOTH);
++ set_irq_type(PCMCIA_S1_CD_VALID, IRQ_TYPE_EDGE_BOTH);
++
++ //irq's for slots:
++ GPDR(IRQ_TO_GPIO(PCMCIA_S0_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S0_RDYINT));
++ GPDR(IRQ_TO_GPIO(PCMCIA_S1_RDYINT)) &= ~GPIO_bit(IRQ_TO_GPIO(PCMCIA_S1_RDYINT));
++
++ set_irq_type(PCMCIA_S0_RDYINT, IRQ_TYPE_EDGE_FALLING);
++ set_irq_type(PCMCIA_S1_RDYINT, IRQ_TYPE_EDGE_FALLING);
++
++ skt->irq = (skt->nr == 0) ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
++ return_val = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
++
++ return return_val;
++}
++
++
++static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt)
++{
++ soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
++
++ set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID), IRQ_TYPE_NONE);
++ set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID), IRQ_TYPE_NONE);
++
++ set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_RDYINT), IRQ_TYPE_NONE);
++ set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_RDYINT), IRQ_TYPE_NONE);
++}
++
++
++static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
++ struct pcmcia_state *state)
++{
++
++ state->detect = (PCC_DETECT(skt->nr) == 0) ? 1 : 0;
++ state->ready = (PCC_READY(skt->nr) == 0) ? 0 : 1;
++ state->bvd1 = 1;
++ state->bvd2 = 1;
++ state->vs_3v = 0;
++ state->vs_Xv = 0;
++ state->wrprot = 0; /* not available */
++
++}
++
++
++static int
++cmx270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
++ const socket_state_t *state)
++{
++
++ GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
++ pxa_gpio_mode(GPIO49_nPWE | GPIO_OUT);
++ //pxa_gpio_mode(GPIO79_pSKTSEL_MD | GPIO_OUT); /* For 2-socket mode */
++
++ switch(skt->nr){
++ case 0:
++ if(state->flags & SS_RESET) {
++ //GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */
++ //udelay(1);
++ GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
++ GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
++ udelay(10);
++ GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
++ GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
++ }
++ break;
++ case 1:
++ if(state->flags & SS_RESET) {
++ //GPCR(GPIO79_pSKTSEL) = GPIO_bit(GPIO79_pSKTSEL); /* For 2-socket mode */
++ //udelay(1);
++ GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
++ GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
++ udelay(10);
++ GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2);
++ GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE);
++ }
++ break;
++ }
++
++ pxa_gpio_mode(GPIO49_nPWE_MD);
++ //pxa_gpio_mode(GPIO79_pSKTSEL_MD); /* For 2-socket mode */
++
++
++ return 0;
++}
++
++static void cmx270_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
++{
++}
++
++static void cmx270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
++{
++}
++
++
++static struct pcmcia_low_level cmx270_pcmcia_ops = {
++ .owner = THIS_MODULE,
++ .hw_init = cmx270_pcmcia_hw_init,
++ .hw_shutdown = cmx270_pcmcia_shutdown,
++ .socket_state = cmx270_pcmcia_socket_state,
++ .configure_socket = cmx270_pcmcia_configure_socket,
++ .socket_init = cmx270_pcmcia_socket_init,
++ .socket_suspend = cmx270_pcmcia_socket_suspend,
++ .nr = 2,
++};
++
++static struct platform_device *cmx270_pcmcia_device;
++
++static int __init cmx270_pcmcia_init(void)
++{
++ int ret;
++
++ cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
++
++ if (!cmx270_pcmcia_device)
++ return -ENOMEM;
++
++ cmx270_pcmcia_device->dev.platform_data = &cmx270_pcmcia_ops;
++
++ printk ("Registering cm-x270 PCMCIA interface.\n");
++ ret = platform_device_add(cmx270_pcmcia_device);
++
++ if (ret)
++ platform_device_put(cmx270_pcmcia_device);
++
++ return ret;
++}
++
++static void __exit cmx270_pcmcia_exit(void)
++{
++ platform_device_unregister(cmx270_pcmcia_device);
++}
++
++module_init(cmx270_pcmcia_init);
++module_exit(cmx270_pcmcia_exit);
++
++MODULE_LICENSE("GPL");
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0006-ramdisk_load.patch b/packages/linux/linux-2.6.23/cm-x270/0006-ramdisk_load.patch
new file mode 100644
index 0000000000..24599e58d0
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0006-ramdisk_load.patch
@@ -0,0 +1,80 @@
+From cbad8cd18463f3b696a8a7df059825f42b497ccd Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 19:01:50 -0400
+Subject: [PATCH] ramdisk_load
+
+---
+ arch/arm/mach-pxa/cm-x270.c | 6 ++++++
+ include/asm-arm/arch-pxa/cm-x270.h | 2 ++
+ init/initramfs.c | 16 ++++++++++++++++
+ 3 files changed, 24 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
+index 7b4e288..598eef1 100644
+--- a/arch/arm/mach-pxa/cm-x270.c
++++ b/arch/arm/mach-pxa/cm-x270.c
+@@ -308,6 +308,12 @@ static struct map_desc cmx270_io_desc[] __initdata = {
+ .length = PXA_CS_SIZE,
+ .type = MT_DEVICE
+ },
++ [2] = { /* NOR flash */
++ .virtual = CMX270_FLASH_VIRT,
++ .pfn = __phys_to_pfn(PXA_CS0_PHYS),
++ .length = (8<<20), /* up to 8 MByte flash */
++ .type = MT_DEVICE
++ },
+ };
+
+ /*
+diff --git a/include/asm-arm/arch-pxa/cm-x270.h b/include/asm-arm/arch-pxa/cm-x270.h
+index 24613a5..aad152e 100644
+--- a/include/asm-arm/arch-pxa/cm-x270.h
++++ b/include/asm-arm/arch-pxa/cm-x270.h
+@@ -20,7 +20,9 @@
+
+ #define CMX270_IT8152_VIRT (CMX270_VIRT_BASE)
+ #define CMX270_IDE104_VIRT (CMX270_IT8152_VIRT + PXA_CS_SIZE)
++#define CMX270_FLASH_VIRT (CMX270_IDE104_VIRT + PXA_CS_SIZE)
+
++#define CMX270_FLASH_RAMDISK_VIRT (CMX270_FLASH_VIRT + 0x1c0000)
+
+ /* GPIO related definitions */
+ #define GPIO_IT8152_IRQ (22)
+diff --git a/init/initramfs.c b/init/initramfs.c
+index 1db02a0..d875fbc 100644
+--- a/init/initramfs.c
++++ b/init/initramfs.c
+@@ -7,6 +7,9 @@
+ #include <linux/string.h>
+ #include <linux/syscalls.h>
+
++// HACK for compulab cm-x270
++#include <asm/arch/cm-x270.h>
++
+ static __initdata char *message;
+ static void __init error(char *x)
+ {
+@@ -550,7 +553,20 @@ static int __init populate_rootfs(void)
+ #ifdef CONFIG_BLK_DEV_INITRD
+ if (initrd_start) {
+ #ifdef CONFIG_BLK_DEV_RAM
++
++ /* hack to make initramfs work because the
++ * compulab BL does not zero out the
++ * initrd memory. This only seems to affect loading
++ * initramfs (cpio.gz) archives. Does not seem to
++ * affect ramdisks.
++ */
++ int initrd_size = *(int *)(CMX270_FLASH_RAMDISK_VIRT);
+ int fd;
++
++ initrd_end = initrd_start + initrd_size;
++ //printk("CLIFF: initrd_start = 0x%x\n", initrd_start);
++ //printk("CLIFF: initrd_end = 0x%x\n", initrd_end);
++
+ printk(KERN_INFO "checking if image is initramfs...");
+ err = unpack_to_rootfs((char *)initrd_start,
+ initrd_end - initrd_start, 1);
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0007-mmcsd_large_cards-r0.patch b/packages/linux/linux-2.6.23/cm-x270/0007-mmcsd_large_cards-r0.patch
new file mode 100644
index 0000000000..0f53fb445e
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0007-mmcsd_large_cards-r0.patch
@@ -0,0 +1,36 @@
+From 9fb3d9729cf908539a769b701d66c708658eff97 Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 19:02:55 -0400
+Subject: [PATCH] mmcsd_large_cards-r0
+
+---
+ drivers/mmc/card/block.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
+index 93fe2e5..7ce961f 100644
+--- a/drivers/mmc/card/block.c
++++ b/drivers/mmc/card/block.c
+@@ -408,6 +408,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
+ {
+ struct mmc_blk_data *md;
+ int devidx, ret;
++ unsigned long cap;
+
+ devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
+ if (devidx >= MMC_NUM_MINORS)
+@@ -471,6 +472,11 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
+
+ sprintf(md->disk->disk_name, "mmcblk%d", devidx);
+
++ if (card->csd.read_blkbits > 9)
++ md->block_bits = 9;
++ else
++ md->block_bits = card->csd.read_blkbits;
++
+ blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
+
+ if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) {
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/0008-cm-x270-nand-simplify-name.patch b/packages/linux/linux-2.6.23/cm-x270/0008-cm-x270-nand-simplify-name.patch
new file mode 100644
index 0000000000..58ed2a276b
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/0008-cm-x270-nand-simplify-name.patch
@@ -0,0 +1,25 @@
+From 3069f49137668b467ba820ed55076df953127582 Mon Sep 17 00:00:00 2001
+From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
+Date: Fri, 20 Jul 2007 19:04:12 -0400
+Subject: [PATCH] cm-x270-nand-simplify-name
+
+---
+ drivers/mtd/nand/cmx270_nand.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
+index cb663ef..3654ce4 100644
+--- a/drivers/mtd/nand/cmx270_nand.c
++++ b/drivers/mtd/nand/cmx270_nand.c
+@@ -191,6 +191,8 @@ static int cmx270_init(void)
+ cmx270_nand_mtd->owner = THIS_MODULE;
+ cmx270_nand_mtd->priv = this;
+
++ cmx270_nand_mtd->name = "cm-x270-nand";
++
+ /* insert callbacks */
+ this->IO_ADDR_R = cmx270_nand_io;
+ this->IO_ADDR_W = cmx270_nand_io;
+--
+1.5.2.5
+
diff --git a/packages/linux/linux-2.6.23/cm-x270/defconfig b/packages/linux/linux-2.6.23/cm-x270/defconfig
new file mode 100644
index 0000000000..273de85b0a
--- /dev/null
+++ b/packages/linux/linux-2.6.23/cm-x270/defconfig
@@ -0,0 +1,1204 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23
+# Thu Oct 11 15:47:57 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION="-cm-x270"
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Intel PXA2xx Implementations
+#
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_PXA_SHARPSL is not set
+# CONFIG_MACH_TRIZEPS4 is not set
+# CONFIG_MACH_EM_X270 is not set
+CONFIG_MACH_ARMCORE=y
+CONFIG_PXA27x=y
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+CONFIG_IWMMXT=y
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+# CONFIG_NO_HZ is not set
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS1,38400 monitor=8 bpp=16 mem=64M mtdparts=physmap-flash.0:256k(boot)ro,0x180000(kernel),-(root);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd3 rootfstype=jffs2"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+# CONFIG_FPE_NWFPE is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_XIP is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x400000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_SHARP_SL is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_H1900 is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_SHARPSL is not set
+CONFIG_MTD_NAND_CM_X270=y
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+CONFIG_DM9000=y
+CONFIG_DM9000_NOEPROM=y
+# CONFIG_SMC911X is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_DM9601 is not set
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+# CONFIG_USB_NET_RNDIS_HOST is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+# CONFIG_USB_NET_ZAURUS is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_PXA27x is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_PS2_ALPS is not set
+# CONFIG_MOUSE_PS2_LOGIPS2PP is not set
+# CONFIG_MOUSE_PS2_SYNAPTICS is not set
+# CONFIG_MOUSE_PS2_LIFEBOOK is not set
+# CONFIG_MOUSE_PS2_TRACKPOINT is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+CONFIG_TOUCHSCREEN_UCB1400=m
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=m
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_PXA=m
+# CONFIG_I2C_PXA_SLAVE is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ABITUGURU3 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_CM_X270=y
+# CONFIG_LEDS_GPIO is not set
+
+#
+# LED Triggers
+#
+# CONFIG_LEDS_TRIGGERS is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+CONFIG_FB_PXA_PARAMETERS=y
+# CONFIG_FB_MBX is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+CONFIG_SND_PXA2XX_PCM=m
+CONFIG_SND_PXA2XX_AC97=m
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_CAIAQ is not set
+
+#
+# System on Chip audio support
+#
+# CONFIG_SND_SOC is not set
+
+#
+# SoC Audio support for SuperH
+#
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_BLOCK_BOUNCE=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_PXA=m
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/packages/linux/linux-bd-neon-2.6-2.6.22/.mtn2git_empty b/packages/linux/linux-bd-neon-2.6-2.6.22/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-bd-neon-2.6-2.6.22/.mtn2git_empty
diff --git a/packages/linux/linux-bd-neon-2.6-2.6.22/neon-jffs2-config.patch b/packages/linux/linux-bd-neon-2.6-2.6.22/neon-jffs2-config.patch
new file mode 100644
index 0000000000..958eda0200
--- /dev/null
+++ b/packages/linux/linux-bd-neon-2.6-2.6.22/neon-jffs2-config.patch
@@ -0,0 +1,33 @@
+--- linux-2.6.22/arch/arm/configs/neon_defconfig-o 2007-08-23 19:49:52.000000000 +0200
++++ linux-2.6.22/arch/arm/configs/neon_defconfig 2007-08-23 19:50:16.000000000 +0200
+@@ -171,7 +171,8 @@
+ # CONFIG_PREEMPT is not set
+ # CONFIG_NO_IDLE_HZ is not set
+ CONFIG_HZ=100
+-# CONFIG_AEABI is not set
++CONFIG_AEABI=y
++CONFIG_OABI_COMPAT=y
+ # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+ CONFIG_SELECT_MEMORY_MODEL=y
+ CONFIG_FLATMEM_MANUAL=y
+@@ -1131,7 +1132,7 @@
+ CONFIG_PROC_FS=y
+ CONFIG_PROC_SYSCTL=y
+ CONFIG_SYSFS=y
+-# CONFIG_TMPFS is not set
++CONFIG_TMPFS=y
+ # CONFIG_HUGETLB_PAGE is not set
+ CONFIG_RAMFS=y
+ # CONFIG_CONFIGFS_FS is not set
+@@ -1147,7 +1148,10 @@
+ # CONFIG_BFS_FS is not set
+ # CONFIG_EFS_FS is not set
+ # CONFIG_JFFS_FS is not set
+-# CONFIG_JFFS2_FS is not set
++CONFIG_JFFS2_FS=y
++CONFIG_JFFS2_FS_DEBUG=0
++CONFIG_JFFS2_FS_WRITEBUFFER=y
++CONFIG_JFFS2_SUMMARY=y
+ CONFIG_CRAMFS=y
+ # CONFIG_VXFS_FS is not set
+ # CONFIG_HPFS_FS is not set
diff --git a/packages/linux/linux-bd-neon-2.6_2.6.22.bb b/packages/linux/linux-bd-neon-2.6_2.6.22.bb
new file mode 100644
index 0000000000..6d2472935f
--- /dev/null
+++ b/packages/linux/linux-bd-neon-2.6_2.6.22.bb
@@ -0,0 +1,48 @@
+DESCRIPTION = "2.6 Linux Kernel for Boundary Devices NEON Board"
+SECTION = "kernel"
+HOMEPAGE = "N/A"
+LICENSE = "GPL"
+DEPENDS += "uboot-utils"
+
+PR = "r1"
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2 \
+ http://www.boundarydevices.com/boundary-2.6.22-2007-07-22.patch.bz2;patch=1 \
+ file://neon-jffs2-config.patch;patch=1"
+
+S = "${WORKDIR}/linux-2.6.22"
+
+inherit kernel
+
+KERNEL_IMAGETYPE = "zImage"
+FILES_kernel-image = ""
+ALLOW_EMPTY = "1"
+
+do_configure() {
+ cp arch/arm/configs/neon_defconfig .config || die "No default configuration for ${MACHINE} available."
+
+# if [ "${TARGET_OS}" == "linux-gnueabi" -o "${TARGET_OS}" == "linux-uclibcgnueabi" ]; then
+# echo "CONFIG_AEABI=y" >> ${S}/.config
+# echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config
+# else
+# echo "# CONFIG_AEABI is not set" >> ${S}/.config
+# echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config
+# fi
+
+ yes '' | oe_runmake oldconfig
+}
+
+do_deploy() {
+ install -d ${DEPLOY_DIR_IMAGE}
+ install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}.bin
+ tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${KERNEL_RELEASE}-${PR}-${MACHINE}.tgz -C ${D} lib
+ ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
+ rm -f linux.bin.gz
+ gzip -9 linux.bin
+ ${STAGING_BINDIR_NATIVE}/mkimage -A arm -O linux -T kernel -C gzip -a a0008000 -e a0008000 -n "Boundary Devices NEON" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${PR}-${MACHINE}.bin
+ rm -f linux.bin.gz
+}
+
+do_deploy[dirs] = "${S}"
+
+addtask deploy before do_package after do_install
diff --git a/packages/linux/linux-efika-2.6.20.20/.mtn2git_empty b/packages/linux/linux-efika-2.6.20.20/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux/linux-efika-2.6.20.20/.mtn2git_empty
diff --git a/packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch b/packages/linux/linux-efika-2.6.20.20/sched-cfs-v9-v2.6.20.11.patch
index 29071a99ac..29071a99ac 100644
--- a/packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch
+++ b/packages/linux/linux-efika-2.6.20.20/sched-cfs-v9-v2.6.20.11.patch
diff --git a/packages/linux/linux-efika-2.6.20.20/weaken-div64_32-symbol.patch b/packages/linux/linux-efika-2.6.20.20/weaken-div64_32-symbol.patch
new file mode 100644
index 0000000000..bd6fb98f61
--- /dev/null
+++ b/packages/linux/linux-efika-2.6.20.20/weaken-div64_32-symbol.patch
@@ -0,0 +1,23 @@
+2.6.20.20 with CFS fails to compile for powerpc, because this arch already has
+its assembly-optimized __div64_32() implementation, so linking fails due to
+two symbols.
+
+The same issue appeared on the s390 arch, so this patch is inspired by it.
+
+http://lkml.org/lkml/2007/4/11/24
+
+Leon 'likewise' Woestenberg <leonw@mailcan.com>
+
+Index: linux-2.6.20/lib/div64.c
+===================================================================
+--- linux-2.6.20.orig/lib/div64.c 2007-10-07 16:19:38.000000000 +0200
++++ linux-2.6.20/lib/div64.c 2007-10-07 16:20:15.000000000 +0200
+@@ -23,7 +23,7 @@
+ /* Not needed on 64bit architectures */
+ #if BITS_PER_LONG == 32
+
+-uint32_t __div64_32(uint64_t *n, uint32_t base)
++uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base)
+ {
+ uint64_t rem = *n;
+ uint64_t b = base;
diff --git a/packages/linux/linux-efika-2.6.20/defconfig b/packages/linux/linux-efika-2.6.20/defconfig
index fb7c9109bf..c68d7f1d1c 100644
--- a/packages/linux/linux-efika-2.6.20/defconfig
+++ b/packages/linux/linux-efika-2.6.20/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20
-# Tue Feb 27 05:45:18 2007
+# Linux kernel version: 2.6.20.20-cfs-v22
+# Sun Oct 7 15:39:14 2007
#
# CONFIG_PPC64 is not set
CONFIG_PPC32=y
@@ -53,6 +53,7 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
#
@@ -69,6 +70,8 @@ CONFIG_POSIX_MQUEUE=y
# CONFIG_UTS_NS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_INITRAMFS_SOURCE=""
@@ -165,9 +168,10 @@ CONFIG_USE_MDIO=y
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
-CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
-# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_BKL=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
@@ -186,8 +190,13 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_PROC_DEVICETREE=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0,9600 console=ttyPSC0,115200"
-# CONFIG_PM is not set
-CONFIG_SECCOMP=y
+CONFIG_PM=y
+# CONFIG_PM_LEGACY is not set
+CONFIG_PM_DEBUG=y
+# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_SECCOMP is not set
CONFIG_ISA_DMA_API=y
#
@@ -1118,7 +1127,115 @@ CONFIG_LOGO=y
#
# Sound
#
-# CONFIG_SOUND is not set
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+CONFIG_SND_DEBUG=y
+# CONFIG_SND_DEBUG_DETECT is not set
+CONFIG_SND_PCM_XRUN_DEBUG=y
+
+#
+# Generic devices
+#
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# PCI devices
+#
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALS300 is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_DARLA20 is not set
+# CONFIG_SND_GINA20 is not set
+# CONFIG_SND_LAYLA20 is not set
+# CONFIG_SND_DARLA24 is not set
+# CONFIG_SND_GINA24 is not set
+# CONFIG_SND_LAYLA24 is not set
+# CONFIG_SND_MONA is not set
+# CONFIG_SND_MIA is not set
+# CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_INDIGO is not set
+# CONFIG_SND_INDIGOIO is not set
+# CONFIG_SND_INDIGODJ is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+# CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RIPTIDE is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+# CONFIG_SND_AC97_POWER_SAVE is not set
+
+#
+# ALSA PowerMac devices
+#
+
+#
+# ALSA PPC devices
+#
+CONFIG_SND_PPC_MPC52xx_AC97=m
+
+#
+# USB devices
+#
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_USX2Y is not set
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
#
# HID Devices
@@ -1140,6 +1257,7 @@ CONFIG_USB=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_BANDWIDTH=y
CONFIG_USB_DYNAMIC_MINORS=y
+# CONFIG_USB_SUSPEND is not set
# CONFIG_USB_OTG is not set
#
@@ -1183,7 +1301,6 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_LIBUSUAL is not set
diff --git a/packages/linux/linux-efika_2.6.20.11.bb b/packages/linux/linux-efika_2.6.20.20.bb
index 2113b27be9..b8877fa5c3 100644
--- a/packages/linux/linux-efika_2.6.20.11.bb
+++ b/packages/linux/linux-efika_2.6.20.20.bb
@@ -41,12 +41,12 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2 \
file://0032-POWERPC-EFIKA-Adds-missing-interrupts-from-bestcomm-node.txt;p=1;patch=1 \
file://0033-EFIKA-fullduplex-prpl_aln.txt;p=1;patch=1 \
file://v4l.diff;p=1;patch=1 \
- http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.20.11.bz2;p=1;patch=1 \
- file://sched-cfs-v9-v2.6.20.11.patch;p=1;patch=1 \
+ http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.20.20.bz2;p=1;patch=1 \
+ http://people.redhat.com/mingo/cfs-scheduler/sched-cfs-v2.6.20.20-v22.patch;p=1;patch=1 \
+ file://weaken-div64_32-symbol.patch;patch=1 \
file://defconfig \
"
-
S = "${WORKDIR}/linux-2.6.20"
inherit kernel
@@ -71,8 +71,6 @@ do_stage_append () {
cp -a include/asm-ppc ${STAGING_KERNEL_DIR}/include/
}
-
-
do_deploy() {
install -d ${DEPLOY_DIR_IMAGE}
install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}
diff --git a/packages/linux/linux-handhelds-2.6.inc b/packages/linux/linux-handhelds-2.6.inc
index 47c32a4a24..e1c8fbf189 100644
--- a/packages/linux/linux-handhelds-2.6.inc
+++ b/packages/linux/linux-handhelds-2.6.inc
@@ -3,7 +3,7 @@ DESCRIPTION = "handhelds.org Linux kernel 2.6 for PocketPCs and other consumer h
LICENSE = "GPL"
COMPATIBLE_HOST = "arm.*-linux"
-COMPATIBLE_MACHINE ?= '(asus620|asus730|aximx50|aximx50v|h1910|h2200|h3600|h3800|h3900|h4000|h5000|htcalpine|htcapache|htcblueangel|htchermes|htchimalaya|htcuniversal|htcwallaby|hx4700|looxc550|jornada56x|magician|rx1950|rx3000)'
+COMPATIBLE_MACHINE ?= '(asus620|asus730|aximx50|aximx50v|h1910|h2200|h3600|h3800|h3900|h4000|h5000|htcalpine|htcapache|htcblueangel|htchermes|htchimalaya|htcsable|htcuniversal|htcwallaby|hx4700|looxc550|jornada56x|magician|rx1950|rx3000)'
# SRC_URI *must* be overriden in includer, but this is a good reference
SRC_URI ?= "${HANDHELDS_CVS};module=linux/kernel26;tag=${@'K' + bb.data.getVar('PV',d,1).replace('.', '-')} \
diff --git a/packages/linux/linux-openmoko-devel/defconfig b/packages/linux/linux-openmoko-devel/defconfig-2.6.23-rc9
index f7274016c8..c2b7151295 100644
--- a/packages/linux/linux-openmoko-devel/defconfig
+++ b/packages/linux/linux-openmoko-devel/defconfig-2.6.23-rc9
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22.1
-# Thu Jul 26 22:01:38 2007
+# Linux kernel version: 2.6.23-rc9
+# Sun Oct 7 15:39:12 2007
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -26,26 +26,21 @@ CONFIG_VECTORS_BASE=0xffff0000
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
-# Code maturity level options
+# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
CONFIG_LOCALVERSION="-moko11"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
# CONFIG_AUDIT is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
@@ -70,7 +65,6 @@ CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
@@ -80,24 +74,17 @@ CONFIG_SLAB=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
-
-#
-# Block layer
-#
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
#
# IO Schedulers
@@ -138,6 +125,7 @@ CONFIG_DEFAULT_IOSCHED="deadline"
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_KS8695 is not set
# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
# CONFIG_ARCH_PNX4008 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_RPC is not set
@@ -149,14 +137,25 @@ CONFIG_ARCH_S3C2410=y
# CONFIG_ARCH_OMAP is not set
CONFIG_PLAT_S3C24XX=y
CONFIG_CPU_S3C244X=y
-# CONFIG_S3C2410_BOOT_WATCHDOG is not set
-CONFIG_S3C2410_BOOT_ERROR_RESET=y
-CONFIG_S3C2410_PM_DEBUG=y
-# CONFIG_S3C2410_PM_CHECK is not set
-CONFIG_S3C2410_LOWLEVEL_UART_PORT=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
CONFIG_MACH_SMDK=y
+CONFIG_PLAT_S3C=y
+CONFIG_CPU_LLSERIAL_S3C2410=y
+CONFIG_CPU_LLSERIAL_S3C2440=y
+
+#
+# Boot options
+#
+# CONFIG_S3C_BOOT_WATCHDOG is not set
+# CONFIG_S3C_BOOT_ERROR_RESET is not set
+
+#
+# Power management
+#
+CONFIG_S3C2410_PM_DEBUG=y
+# CONFIG_S3C2410_PM_CHECK is not set
+CONFIG_S3C_LOWLEVEL_UART_PORT=0
#
# S3C2400 Machines
@@ -237,6 +236,7 @@ CONFIG_ARM_THUMB=y
#
# Bus support
#
+# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
#
@@ -251,7 +251,8 @@ CONFIG_ARM_THUMB=y
CONFIG_PREEMPT=y
CONFIG_NO_IDLE_HZ=y
CONFIG_HZ=200
-# CONFIG_AEABI is not set
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
@@ -263,6 +264,8 @@ CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPLIT_PTLOCK_CPUS=4096
# CONFIG_RESOURCES_64BIT is not set
CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
CONFIG_ALIGNMENT_TRAP=y
#
@@ -270,7 +273,7 @@ CONFIG_ALIGNMENT_TRAP=y
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="ip=192.168.1.2:192.168.1.10:192.168.1.10:255.255.255.0:ezx:usb0:off"
+CONFIG_CMDLINE="unused -- bootloader passes ATAG list"
# CONFIG_XIP_KERNEL is not set
CONFIG_KEXEC=y
@@ -282,6 +285,7 @@ CONFIG_KEXEC=y
# At least one emulation must be selected
#
CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set
#
@@ -290,7 +294,6 @@ CONFIG_FPE_NWFPE=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BINFMT_MISC is not set
-# CONFIG_ARTHUR is not set
#
# Power management options
@@ -298,8 +301,11 @@ CONFIG_BINFMT_ELF=y
CONFIG_PM=y
CONFIG_PM_LEGACY=y
CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
CONFIG_DISABLE_CONSOLE_SUSPEND=y
-# CONFIG_PM_SYSFS_DEPRECATED is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND_UP_POSSIBLE=y
+CONFIG_SUSPEND=y
CONFIG_APM_EMULATION=y
#
@@ -388,6 +394,7 @@ CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
+# CONFIG_NF_CT_PROTO_UDPLITE is not set
# CONFIG_NF_CONNTRACK_AMANDA is not set
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_CONNTRACK_H323=m
@@ -408,6 +415,7 @@ CONFIG_NETFILTER_XT_TARGET_NFLOG=m
CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DCCP=m
@@ -429,6 +437,7 @@ CONFIG_NETFILTER_XT_MATCH_STATE=m
CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
CONFIG_NETFILTER_XT_MATCH_STRING=m
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
#
@@ -547,6 +556,7 @@ CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RR=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
@@ -574,7 +584,6 @@ CONFIG_NET_CLS_RSVP6=m
# CONFIG_NET_CLS_ACT is not set
# CONFIG_NET_CLS_POLICE is not set
# CONFIG_NET_CLS_IND is not set
-CONFIG_NET_ESTIMATOR=y
#
# Network testing
@@ -613,6 +622,7 @@ CONFIG_FIB_RULES=y
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
#
# Device Drivers
@@ -627,10 +637,6 @@ CONFIG_FW_LOADER=m
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
CONFIG_CONNECTOR=m
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
@@ -712,20 +718,8 @@ CONFIG_MTD_NAND_S3C2410_CLKSTOP=y
# UBI - Unsorted block images
#
# CONFIG_MTD_UBI is not set
-
-#
-# Parallel port support
-#
# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -744,6 +738,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=m
+CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y
@@ -774,19 +769,11 @@ CONFIG_SCSI_WAIT_SCAN=m
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
CONFIG_MD=y
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_DM=m
@@ -797,22 +784,17 @@ CONFIG_DM_SNAPSHOT=m
# CONFIG_DM_ZERO is not set
# CONFIG_DM_MULTIPATH is not set
# CONFIG_DM_DELAY is not set
-
-#
-# Network device support
-#
CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
CONFIG_NET_ETHERNET=y
CONFIG_MII=m
+# CONFIG_AX88796 is not set
# CONFIG_SMC91X is not set
# CONFIG_DM9000 is not set
CONFIG_NET_PCI=y
@@ -861,16 +843,13 @@ CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
# CONFIG_SLIP is not set
CONFIG_SLHC=m
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
# CONFIG_ISDN is not set
#
@@ -910,10 +889,12 @@ CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
CONFIG_TOUCHSCREEN_S3C2410=y
# CONFIG_TOUCHSCREEN_S3C2410_DEBUG is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
@@ -959,10 +940,6 @@ CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set
-
-#
-# IPMI
-#
# CONFIG_IPMI_HANDLER is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
@@ -981,10 +958,6 @@ CONFIG_S3C2410_WATCHDOG=m
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
# CONFIG_TCG_TPM is not set
# CONFIG_TS0710_MUX is not set
CONFIG_I2C=y
@@ -1006,6 +979,7 @@ CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_PARPORT_LIGHT is not set
CONFIG_I2C_S3C2410=y
# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_TINY_USB is not set
@@ -1014,6 +988,7 @@ CONFIG_I2C_S3C2410=y
#
# CONFIG_SENSORS_DS1337 is not set
# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
# CONFIG_SENSORS_EEPROM is not set
CONFIG_SENSORS_PCF50606=y
CONFIG_SENSORS_PCF50633=y
@@ -1021,6 +996,7 @@ CONFIG_SENSORS_PCF50633=y
# CONFIG_SENSORS_PCA9539 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
CONFIG_SENSORS_TSL256X=m
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1046,15 +1022,13 @@ CONFIG_SPI_S3C24XX_GPIO=y
#
# CONFIG_SPI_AT25 is not set
# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
CONFIG_SPI_SLAVE_JBT6K74=y
-
-#
-# Dallas's 1-wire bus
-#
# CONFIG_W1 is not set
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
@@ -1082,13 +1056,16 @@ CONFIG_HWMON=y
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
@@ -1098,27 +1075,21 @@ CONFIG_HWMON=y
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Misc devices
-#
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
-
-#
-# LED devices
-#
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
#
# LED drivers
#
-CONFIG_LEDS_S3C24XX=m
-CONFIG_LEDS_GTA01=y
+CONFIG_LEDS_S3C24XX=y
+# CONFIG_LEDS_GPIO is not set
#
# LED Triggers
@@ -1139,8 +1110,8 @@ CONFIG_DAB=y
# Graphics support
#
CONFIG_BACKLIGHT_LCD_SUPPORT=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_GTA01=y
#
@@ -1148,6 +1119,7 @@ CONFIG_BACKLIGHT_GTA01=y
#
# CONFIG_DISPLAY_SUPPORT is not set
# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
@@ -1183,6 +1155,7 @@ CONFIG_FB_GLAMO_SPI=y
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
CONFIG_FONTS=y
# CONFIG_FONT_8x8 is not set
@@ -1195,10 +1168,11 @@ CONFIG_FONT_6x11=y
# CONFIG_FONT_SUN8x16 is not set
# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_10x18 is not set
-# CONFIG_LOGO is not set
+CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO_OPENMOKO_CLUT224 is not set
#
# Sound
@@ -1246,23 +1220,20 @@ CONFIG_SND_USB_AUDIO=m
# System on Chip audio support
#
CONFIG_SND_SOC=y
-CONFIG_SND_S3C24XX_SOC=m
-CONFIG_SND_S3C24XX_SOC_I2S=m
-CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=m
+CONFIG_SND_S3C24XX_SOC=y
+CONFIG_SND_S3C24XX_SOC_I2S=y
+CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=y
#
# SoC Audio support for SuperH
#
-CONFIG_SND_SOC_WM8753=m
+CONFIG_SND_SOC_WM8753=y
#
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
CONFIG_HID=y
# CONFIG_HID_DEBUG is not set
@@ -1279,10 +1250,7 @@ CONFIG_USB_HID=m
#
# CONFIG_USB_KBD is not set
# CONFIG_USB_MOUSE is not set
-
-#
-# USB support
-#
+CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
# CONFIG_USB_ARCH_HAS_EHCI is not set
@@ -1296,6 +1264,7 @@ CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_PERSIST is not set
# CONFIG_USB_OTG is not set
#
@@ -1307,6 +1276,7 @@ CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
#
# USB Device Class drivers
@@ -1389,6 +1359,7 @@ CONFIG_USB_SERIAL_MOS7720=m
CONFIG_USB_SERIAL_MOS7840=m
CONFIG_USB_SERIAL_NAVMAN=m
CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
CONFIG_USB_SERIAL_HP4X=m
CONFIG_USB_SERIAL_SAFE=m
CONFIG_USB_SERIAL_SAFE_PADDED=y
@@ -1432,11 +1403,14 @@ CONFIG_USB_IOWARRIOR=m
# USB Gadget Support
#
CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
# CONFIG_USB_GADGET_FSL_USB2 is not set
# CONFIG_USB_GADGET_NET2280 is not set
# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
# CONFIG_USB_GADGET_GOKU is not set
# CONFIG_USB_GADGET_LH7A40X is not set
# CONFIG_USB_GADGET_OMAP is not set
@@ -1461,15 +1435,12 @@ CONFIG_MMC_UNSAFE_RESUME=y
# MMC/SD Card Drivers
#
CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
#
# MMC/SD Host Controller Drivers
#
CONFIG_MMC_S3C=y
-
-#
-# Real Time Clock
-#
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
@@ -1496,6 +1467,7 @@ CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
#
# SPI RTC drivers
@@ -1508,8 +1480,10 @@ CONFIG_RTC_INTF_DEV=y
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_V3020 is not set
#
@@ -1518,6 +1492,19 @@ CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_DRV_S3C=m
#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
# File systems
#
CONFIG_EXT2_FS=m
@@ -1586,6 +1573,7 @@ CONFIG_CONFIGFS_FS=m
# CONFIG_EFS_FS is not set
CONFIG_YAFFS_FS=y
CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
# CONFIG_YAFFS_DOES_ECC is not set
CONFIG_YAFFS_YAFFS2=y
CONFIG_YAFFS_AUTO_YAFFS2=y
@@ -1647,7 +1635,6 @@ CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
#
# Partition Types
@@ -1721,6 +1708,7 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
# CONFIG_DEBUG_SLAB is not set
@@ -1731,6 +1719,7 @@ CONFIG_DEBUG_PREEMPT=y
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
@@ -1746,18 +1735,14 @@ CONFIG_FORCED_INLINING=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_LL=y
# CONFIG_DEBUG_ICEDCC is not set
-CONFIG_DEBUG_S3C2410_PORT=y
-CONFIG_DEBUG_S3C2410_UART=0
+# CONFIG_DEBUG_S3C_PORT is not set
+CONFIG_DEBUG_S3C_UART=0
#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=y
@@ -1797,10 +1782,7 @@ CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_TEST=m
-
-#
-# Hardware crypto devices
-#
+CONFIG_CRYPTO_HW=y
#
# Library routines
@@ -1810,6 +1792,7 @@ CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
diff --git a/packages/linux/linux-openmoko-devel/squashfs-2.6.23.patch b/packages/linux/linux-openmoko-devel/squashfs-2.6.23.patch
new file mode 100644
index 0000000000..f4457a8715
--- /dev/null
+++ b/packages/linux/linux-openmoko-devel/squashfs-2.6.23.patch
@@ -0,0 +1,4395 @@
+Index: linux-2.6.22/fs/Kconfig
+===================================================================
+--- linux-2.6.22.orig/fs/Kconfig
++++ linux-2.6.22/fs/Kconfig
+@@ -1368,6 +1368,71 @@
+
+ If unsure, say N.
+
++config SQUASHFS
++ tristate "SquashFS 3.2 - Squashed file system support"
++ select ZLIB_INFLATE
++ help
++ Saying Y here includes support for SquashFS 3.2 (a Compressed Read-Only File
++ System). Squashfs is a highly compressed read-only filesystem for Linux.
++ It uses zlib compression to compress both files, inodes and directories.
++ Inodes in the system are very small and all blocks are packed to minimise
++ data overhead. Block sizes greater than 4K are supported up to a maximum of 64K.
++ SquashFS 3.1 supports 64 bit filesystems and files (larger than 4GB), full
++ uid/gid information, hard links and timestamps.
++
++ Squashfs is intended for general read-only filesystem use, for archival
++ use (i.e. in cases where a .tar.gz file may be used), and in embedded
++ systems where low overhead is needed. Further information and filesystem tools
++ are available from http://squashfs.sourceforge.net.
++
++ If you want to compile this as a module ( = code which can be
++ inserted in and removed from the running kernel whenever you want),
++ say M here and read <file:Documentation/modules.txt>. The module
++ will be called squashfs. Note that the root file system (the one
++ containing the directory /) cannot be compiled as a module.
++
++ If unsure, say N.
++
++config SQUASHFS_EMBEDDED
++
++ bool "Additional options for memory-constrained systems"
++ depends on SQUASHFS
++ default n
++ help
++ Saying Y here allows you to specify cache sizes and how Squashfs
++ allocates memory. This is only intended for memory constrained
++ systems.
++
++ If unsure, say N.
++
++config SQUASHFS_FRAGMENT_CACHE_SIZE
++ int "Number of fragments cached" if SQUASHFS_EMBEDDED
++ depends on SQUASHFS
++ default "3"
++ help
++ By default SquashFS caches the last 3 fragments read from
++ the filesystem. Increasing this amount may mean SquashFS
++ has to re-read fragments less often from disk, at the expense
++ of extra system memory. Decreasing this amount will mean
++ SquashFS uses less memory at the expense of extra reads from disk.
++
++ Note there must be at least one cached fragment. Anything
++ much more than three will probably not make much difference.
++
++config SQUASHFS_VMALLOC
++ bool "Use Vmalloc rather than Kmalloc" if SQUASHFS_EMBEDDED
++ depends on SQUASHFS
++ default n
++ help
++ By default SquashFS uses kmalloc to obtain fragment cache memory.
++ Kmalloc memory is the standard kernel allocator, but it can fail
++ on memory constrained systems. Because of the way Vmalloc works,
++ Vmalloc can succeed when kmalloc fails. Specifying this option
++ will make SquashFS always use Vmalloc to allocate the
++ fragment cache memory.
++
++ If unsure, say N.
++
+ config VXFS_FS
+ tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
+ depends on BLOCK
+Index: linux-2.6.22/fs/Makefile
+===================================================================
+--- linux-2.6.22.orig/fs/Makefile
++++ linux-2.6.22/fs/Makefile
+@@ -72,6 +72,7 @@
+ obj-$(CONFIG_JBD2) += jbd2/
+ obj-$(CONFIG_EXT2_FS) += ext2/
+ obj-$(CONFIG_CRAMFS) += cramfs/
++obj-$(CONFIG_SQUASHFS) += squashfs/
+ obj-$(CONFIG_RAMFS) += ramfs/
+ obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
+ obj-$(CONFIG_CODA_FS) += coda/
+Index: linux-2.6.22/fs/squashfs/inode.c
+===================================================================
+--- /dev/null
++++ linux-2.6.22/fs/squashfs/inode.c
+@@ -0,0 +1,2328 @@
++/*
++ * Squashfs - a compressed read only filesystem for Linux
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * inode.c
++ */
++
++#include <linux/squashfs_fs.h>
++#include <linux/module.h>
++#include <linux/zlib.h>
++#include <linux/fs.h>
++#include <linux/squashfs_fs_sb.h>
++#include <linux/squashfs_fs_i.h>
++#include <linux/buffer_head.h>
++#include <linux/vfs.h>
++#include <linux/vmalloc.h>
++#include <linux/smp_lock.h>
++#include <linux/exportfs.h>
++
++#include "squashfs.h"
++
++static void vfs_read_inode(struct inode *i);
++static struct dentry *squashfs_get_parent(struct dentry *child);
++static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode);
++static int squashfs_statfs(struct dentry *, struct kstatfs *);
++static int squashfs_symlink_readpage(struct file *file, struct page *page);
++static long long read_blocklist(struct inode *inode, int index,
++ int readahead_blks, char *block_list,
++ unsigned short **block_p, unsigned int *bsize);
++static int squashfs_readpage(struct file *file, struct page *page);
++static int squashfs_readpage4K(struct file *file, struct page *page);
++static int squashfs_readdir(struct file *, void *, filldir_t);
++static struct dentry *squashfs_lookup(struct inode *, struct dentry *,
++ struct nameidata *);
++static int squashfs_remount(struct super_block *s, int *flags, char *data);
++static void squashfs_put_super(struct super_block *);
++static int squashfs_get_sb(struct file_system_type *,int, const char *, void *,
++ struct vfsmount *);
++static struct inode *squashfs_alloc_inode(struct super_block *sb);
++static void squashfs_destroy_inode(struct inode *inode);
++static int init_inodecache(void);
++static void destroy_inodecache(void);
++
++static struct file_system_type squashfs_fs_type = {
++ .owner = THIS_MODULE,
++ .name = "squashfs",
++ .get_sb = squashfs_get_sb,
++ .kill_sb = kill_block_super,
++ .fs_flags = FS_REQUIRES_DEV
++};
++
++static const unsigned char squashfs_filetype_table[] = {
++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
++};
++
++static struct super_operations squashfs_super_ops = {
++ .alloc_inode = squashfs_alloc_inode,
++ .destroy_inode = squashfs_destroy_inode,
++ .statfs = squashfs_statfs,
++ .put_super = squashfs_put_super,
++ .remount_fs = squashfs_remount
++};
++
++static struct super_operations squashfs_export_super_ops = {
++ .alloc_inode = squashfs_alloc_inode,
++ .destroy_inode = squashfs_destroy_inode,
++ .statfs = squashfs_statfs,
++ .put_super = squashfs_put_super,
++ .read_inode = vfs_read_inode
++};
++
++static struct export_operations squashfs_export_ops = {
++ .get_parent = squashfs_get_parent
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_symlink_aops = {
++ .readpage = squashfs_symlink_readpage
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_aops = {
++ .readpage = squashfs_readpage
++};
++
++SQSH_EXTERN const struct address_space_operations squashfs_aops_4K = {
++ .readpage = squashfs_readpage4K
++};
++
++static const struct file_operations squashfs_dir_ops = {
++ .read = generic_read_dir,
++ .readdir = squashfs_readdir
++};
++
++SQSH_EXTERN struct inode_operations squashfs_dir_inode_ops = {
++ .lookup = squashfs_lookup
++};
++
++
++static struct buffer_head *get_block_length(struct super_block *s,
++ int *cur_index, int *offset, int *c_byte)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ unsigned short temp;
++ struct buffer_head *bh;
++
++ if (!(bh = sb_bread(s, *cur_index)))
++ goto out;
++
++ if (msblk->devblksize - *offset == 1) {
++ if (msblk->swap)
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset));
++ else
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset));
++ brelse(bh);
++ if (!(bh = sb_bread(s, ++(*cur_index))))
++ goto out;
++ if (msblk->swap)
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ bh->b_data);
++ else
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ bh->b_data);
++ *c_byte = temp;
++ *offset = 1;
++ } else {
++ if (msblk->swap) {
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset));
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset + 1));
++ } else {
++ ((unsigned char *) &temp)[0] = *((unsigned char *)
++ (bh->b_data + *offset));
++ ((unsigned char *) &temp)[1] = *((unsigned char *)
++ (bh->b_data + *offset + 1));
++ }
++ *c_byte = temp;
++ *offset += 2;
++ }
++
++ if (SQUASHFS_CHECK_DATA(msblk->sblk.flags)) {
++ if (*offset == msblk->devblksize) {
++ brelse(bh);
++ if (!(bh = sb_bread(s, ++(*cur_index))))
++ goto out;
++ *offset = 0;
++ }
++ if (*((unsigned char *) (bh->b_data + *offset)) !=
++ SQUASHFS_MARKER_BYTE) {
++ ERROR("Metadata block marker corrupt @ %x\n",
++ *cur_index);
++ brelse(bh);
++ goto out;
++ }
++ (*offset)++;
++ }
++ return bh;
++
++out:
++ return NULL;
++}
++
++
++SQSH_EXTERN unsigned int squashfs_read_data(struct super_block *s, char *buffer,
++ long long index, unsigned int length,
++ long long *next_index, int srclength)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ struct buffer_head *bh[((SQUASHFS_FILE_MAX_SIZE - 1) >>
++ msblk->devblksize_log2) + 2];
++ unsigned int offset = index & ((1 << msblk->devblksize_log2) - 1);
++ unsigned int cur_index = index >> msblk->devblksize_log2;
++ int bytes, avail_bytes, b = 0, k = 0;
++ unsigned int compressed;
++ unsigned int c_byte = length;
++
++ if (c_byte) {
++ bytes = msblk->devblksize - offset;
++ compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte);
++ c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte);
++
++ TRACE("Block @ 0x%llx, %scompressed size %d, src size %d\n", index, compressed
++ ? "" : "un", (unsigned int) c_byte, srclength);
++
++ if (c_byte > srclength || index < 0 || (index + c_byte) > sblk->bytes_used)
++ goto read_failure;
++
++ if (!(bh[0] = sb_getblk(s, cur_index)))
++ goto block_release;
++
++ for (b = 1; bytes < c_byte; b++) {
++ if (!(bh[b] = sb_getblk(s, ++cur_index)))
++ goto block_release;
++ bytes += msblk->devblksize;
++ }
++ ll_rw_block(READ, b, bh);
++ } else {
++ if (index < 0 || (index + 2) > sblk->bytes_used)
++ goto read_failure;
++
++ if (!(bh[0] = get_block_length(s, &cur_index, &offset,
++ &c_byte)))
++ goto read_failure;
++
++ bytes = msblk->devblksize - offset;
++ compressed = SQUASHFS_COMPRESSED(c_byte);
++ c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte);
++
++ TRACE("Block @ 0x%llx, %scompressed size %d\n", index, compressed
++ ? "" : "un", (unsigned int) c_byte);
++
++ if (c_byte > srclength || (index + c_byte) > sblk->bytes_used)
++ goto read_failure;
++
++ for (b = 1; bytes < c_byte; b++) {
++ if (!(bh[b] = sb_getblk(s, ++cur_index)))
++ goto block_release;
++ bytes += msblk->devblksize;
++ }
++ ll_rw_block(READ, b - 1, bh + 1);
++ }
++
++ if (compressed) {
++ int zlib_err = 0;
++
++ /*
++ * uncompress block
++ */
++
++ mutex_lock(&msblk->read_data_mutex);
++
++ msblk->stream.next_out = buffer;
++ msblk->stream.avail_out = srclength;
++
++ for (bytes = 0; k < b; k++) {
++ avail_bytes = (c_byte - bytes) > (msblk->devblksize - offset) ?
++ msblk->devblksize - offset :
++ c_byte - bytes;
++ wait_on_buffer(bh[k]);
++ if (!buffer_uptodate(bh[k]))
++ goto release_mutex;
++
++ msblk->stream.next_in = bh[k]->b_data + offset;
++ msblk->stream.avail_in = avail_bytes;
++
++ if (k == 0) {
++ zlib_err = zlib_inflateInit(&msblk->stream);
++ if (zlib_err != Z_OK) {
++ ERROR("zlib_inflateInit returned unexpected result 0x%x, srclength %d\n",
++ zlib_err, srclength);
++ goto release_mutex;
++ }
++
++ if (avail_bytes == 0) {
++ offset = 0;
++ brelse(bh[k]);
++ continue;
++ }
++ }
++
++ zlib_err = zlib_inflate(&msblk->stream, Z_NO_FLUSH);
++ if (zlib_err != Z_OK && zlib_err != Z_STREAM_END) {
++ ERROR("zlib_inflate returned unexpected result 0x%x, srclength %d, avail_in %d, avail_out %d\n",
++ zlib_err, srclength, msblk->stream.avail_in, msblk->stream.avail_out);
++ goto release_mutex;
++ }
++
++ bytes += avail_bytes;
++ offset = 0;
++ brelse(bh[k]);
++ }
++
++ if (zlib_err != Z_STREAM_END)
++ goto release_mutex;
++
++ zlib_err = zlib_inflateEnd(&msblk->stream);
++ if (zlib_err != Z_OK) {
++ ERROR("zlib_inflateEnd returned unexpected result 0x%x, srclength %d\n",
++ zlib_err, srclength);
++ goto release_mutex;
++ }
++ bytes = msblk->stream.total_out;
++ mutex_unlock(&msblk->read_data_mutex);
++ } else {
++ int i;
++
++ for(i = 0; i < b; i++) {
++ wait_on_buffer(bh[i]);
++ if(!buffer_uptodate(bh[i]))
++ goto block_release;
++ }
++
++ for (bytes = 0; k < b; k++) {
++ avail_bytes = (c_byte - bytes) > (msblk->devblksize - offset) ?
++ msblk->devblksize - offset :
++ c_byte - bytes;
++ memcpy(buffer + bytes, bh[k]->b_data + offset, avail_bytes);
++ bytes += avail_bytes;
++ offset = 0;
++ brelse(bh[k]);
++ }
++ }
++
++ if (next_index)
++ *next_index = index + c_byte + (length ? 0 :
++ (SQUASHFS_CHECK_DATA(msblk->sblk.flags)
++ ? 3 : 2));
++ return bytes;
++
++release_mutex:
++ mutex_unlock(&msblk->read_data_mutex);
++
++block_release:
++ for (; k < b; k++)
++ brelse(bh[k]);
++
++read_failure:
++ ERROR("sb_bread failed reading block 0x%x\n", cur_index);
++ return 0;
++}
++
++
++SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, char *buffer,
++ long long block, unsigned int offset,
++ int length, long long *next_block,
++ unsigned int *next_offset)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ int n, i, bytes, return_length = length;
++ long long next_index;
++
++ TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset);
++
++ while ( 1 ) {
++ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
++ if (msblk->block_cache[i].block == block)
++ break;
++
++ mutex_lock(&msblk->block_cache_mutex);
++
++ if (i == SQUASHFS_CACHED_BLKS) {
++ /* read inode header block */
++ for (i = msblk->next_cache, n = SQUASHFS_CACHED_BLKS;
++ n ; n --, i = (i + 1) %
++ SQUASHFS_CACHED_BLKS)
++ if (msblk->block_cache[i].block !=
++ SQUASHFS_USED_BLK)
++ break;
++
++ if (n == 0) {
++ wait_queue_t wait;
++
++ init_waitqueue_entry(&wait, current);
++ add_wait_queue(&msblk->waitq, &wait);
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ mutex_unlock(&msblk->block_cache_mutex);
++ schedule();
++ set_current_state(TASK_RUNNING);
++ remove_wait_queue(&msblk->waitq, &wait);
++ continue;
++ }
++ msblk->next_cache = (i + 1) % SQUASHFS_CACHED_BLKS;
++
++ if (msblk->block_cache[i].block ==
++ SQUASHFS_INVALID_BLK) {
++ if (!(msblk->block_cache[i].data =
++ kmalloc(SQUASHFS_METADATA_SIZE,
++ GFP_KERNEL))) {
++ ERROR("Failed to allocate cache"
++ "block\n");
++ mutex_unlock(&msblk->block_cache_mutex);
++ goto out;
++ }
++ }
++
++ msblk->block_cache[i].block = SQUASHFS_USED_BLK;
++ mutex_unlock(&msblk->block_cache_mutex);
++
++ msblk->block_cache[i].length = squashfs_read_data(s,
++ msblk->block_cache[i].data, block, 0, &next_index, SQUASHFS_METADATA_SIZE);
++ if (msblk->block_cache[i].length == 0) {
++ ERROR("Unable to read cache block [%llx:%x]\n",
++ block, offset);
++ mutex_lock(&msblk->block_cache_mutex);
++ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK;
++ kfree(msblk->block_cache[i].data);
++ wake_up(&msblk->waitq);
++ mutex_unlock(&msblk->block_cache_mutex);
++ goto out;
++ }
++
++ mutex_lock(&msblk->block_cache_mutex);
++ wake_up(&msblk->waitq);
++ msblk->block_cache[i].block = block;
++ msblk->block_cache[i].next_index = next_index;
++ TRACE("Read cache block [%llx:%x]\n", block, offset);
++ }
++
++ if (msblk->block_cache[i].block != block) {
++ mutex_unlock(&msblk->block_cache_mutex);
++ continue;
++ }
++
++ bytes = msblk->block_cache[i].length - offset;
++
++ if (bytes < 1) {
++ mutex_unlock(&msblk->block_cache_mutex);
++ goto out;
++ } else if (bytes >= length) {
++ if (buffer)
++ memcpy(buffer, msblk->block_cache[i].data +
++ offset, length);
++ if (msblk->block_cache[i].length - offset == length) {
++ *next_block = msblk->block_cache[i].next_index;
++ *next_offset = 0;
++ } else {
++ *next_block = block;
++ *next_offset = offset + length;
++ }
++ mutex_unlock(&msblk->block_cache_mutex);
++ goto finish;
++ } else {
++ if (buffer) {
++ memcpy(buffer, msblk->block_cache[i].data +
++ offset, bytes);
++ buffer += bytes;
++ }
++ block = msblk->block_cache[i].next_index;
++ mutex_unlock(&msblk->block_cache_mutex);
++ length -= bytes;
++ offset = 0;
++ }
++ }
++
++finish:
++ return return_length;
++out:
++ return 0;
++}
++
++
++static int get_fragment_location(struct super_block *s, unsigned int fragment,
++ long long *fragment_start_block,
++ unsigned int *fragment_size)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ long long start_block =
++ msblk->fragment_index[SQUASHFS_FRAGMENT_INDEX(fragment)];
++ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment);
++ struct squashfs_fragment_entry fragment_entry;
++
++ if (msblk->swap) {
++ struct squashfs_fragment_entry sfragment_entry;
++
++ if (!squashfs_get_cached_block(s, (char *) &sfragment_entry,
++ start_block, offset,
++ sizeof(sfragment_entry), &start_block,
++ &offset))
++ goto out;
++ SQUASHFS_SWAP_FRAGMENT_ENTRY(&fragment_entry, &sfragment_entry);
++ } else
++ if (!squashfs_get_cached_block(s, (char *) &fragment_entry,
++ start_block, offset,
++ sizeof(fragment_entry), &start_block,
++ &offset))
++ goto out;
++
++ *fragment_start_block = fragment_entry.start_block;
++ *fragment_size = fragment_entry.size;
++
++ return 1;
++
++out:
++ return 0;
++}
++
++
++SQSH_EXTERN void release_cached_fragment(struct squashfs_sb_info *msblk, struct
++ squashfs_fragment_cache *fragment)
++{
++ mutex_lock(&msblk->fragment_mutex);
++ fragment->locked --;
++ wake_up(&msblk->fragment_wait_queue);
++ mutex_unlock(&msblk->fragment_mutex);
++}
++
++
++SQSH_EXTERN struct squashfs_fragment_cache *get_cached_fragment(struct super_block
++ *s, long long start_block,
++ int length)
++{
++ int i, n;
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ while ( 1 ) {
++ mutex_lock(&msblk->fragment_mutex);
++
++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS &&
++ msblk->fragment[i].block != start_block; i++);
++
++ if (i == SQUASHFS_CACHED_FRAGMENTS) {
++ for (i = msblk->next_fragment, n =
++ SQUASHFS_CACHED_FRAGMENTS; n &&
++ msblk->fragment[i].locked; n--, i = (i + 1) %
++ SQUASHFS_CACHED_FRAGMENTS);
++
++ if (n == 0) {
++ wait_queue_t wait;
++
++ init_waitqueue_entry(&wait, current);
++ add_wait_queue(&msblk->fragment_wait_queue,
++ &wait);
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ mutex_unlock(&msblk->fragment_mutex);
++ schedule();
++ set_current_state(TASK_RUNNING);
++ remove_wait_queue(&msblk->fragment_wait_queue,
++ &wait);
++ continue;
++ }
++ msblk->next_fragment = (msblk->next_fragment + 1) %
++ SQUASHFS_CACHED_FRAGMENTS;
++
++ if (msblk->fragment[i].data == NULL)
++ if (!(msblk->fragment[i].data = SQUASHFS_ALLOC
++ (SQUASHFS_FILE_MAX_SIZE))) {
++ ERROR("Failed to allocate fragment "
++ "cache block\n");
++ mutex_unlock(&msblk->fragment_mutex);
++ goto out;
++ }
++
++ msblk->fragment[i].block = SQUASHFS_INVALID_BLK;
++ msblk->fragment[i].locked = 1;
++ mutex_unlock(&msblk->fragment_mutex);
++
++ if (!(msblk->fragment[i].length = squashfs_read_data(s,
++ msblk->fragment[i].data,
++ start_block, length, NULL, sblk->block_size))) {
++ ERROR("Unable to read fragment cache block "
++ "[%llx]\n", start_block);
++ msblk->fragment[i].locked = 0;
++ smp_mb();
++ goto out;
++ }
++
++ mutex_lock(&msblk->fragment_mutex);
++ msblk->fragment[i].block = start_block;
++ TRACE("New fragment %d, start block %lld, locked %d\n",
++ i, msblk->fragment[i].block,
++ msblk->fragment[i].locked);
++ mutex_unlock(&msblk->fragment_mutex);
++ break;
++ }
++
++ msblk->fragment[i].locked++;
++ mutex_unlock(&msblk->fragment_mutex);
++ TRACE("Got fragment %d, start block %lld, locked %d\n", i,
++ msblk->fragment[i].block,
++ msblk->fragment[i].locked);
++ break;
++ }
++
++ return &msblk->fragment[i];
++
++out:
++ return NULL;
++}
++
++
++static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i,
++ struct squashfs_base_inode_header *inodeb)
++{
++ i->i_ino = inodeb->inode_number;
++ i->i_mtime.tv_sec = inodeb->mtime;
++ i->i_atime.tv_sec = inodeb->mtime;
++ i->i_ctime.tv_sec = inodeb->mtime;
++ i->i_uid = msblk->uid[inodeb->uid];
++ i->i_mode = inodeb->mode;
++ i->i_size = 0;
++ if (inodeb->guid == SQUASHFS_GUIDS)
++ i->i_gid = i->i_uid;
++ else
++ i->i_gid = msblk->guid[inodeb->guid];
++}
++
++
++static squashfs_inode_t squashfs_inode_lookup(struct super_block *s, int ino)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ long long start = msblk->inode_lookup_table[SQUASHFS_LOOKUP_BLOCK(ino - 1)];
++ int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino - 1);
++ squashfs_inode_t inode;
++
++ TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino);
++
++ if (msblk->swap) {
++ squashfs_inode_t sinode;
++
++ if (!squashfs_get_cached_block(s, (char *) &sinode, start, offset,
++ sizeof(sinode), &start, &offset))
++ goto out;
++ SQUASHFS_SWAP_INODE_T((&inode), &sinode);
++ } else if (!squashfs_get_cached_block(s, (char *) &inode, start, offset,
++ sizeof(inode), &start, &offset))
++ goto out;
++
++ TRACE("squashfs_inode_lookup, inode = 0x%llx\n", inode);
++
++ return inode;
++
++out:
++ return SQUASHFS_INVALID_BLK;
++}
++
++
++static void vfs_read_inode(struct inode *i)
++{
++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
++ squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino);
++
++ TRACE("Entered vfs_read_inode\n");
++
++ if(inode != SQUASHFS_INVALID_BLK)
++ (msblk->read_inode)(i, inode);
++}
++
++
++static struct dentry *squashfs_get_parent(struct dentry *child)
++{
++ struct inode *i = child->d_inode;
++ struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode);
++ struct dentry *rv;
++
++ TRACE("Entered squashfs_get_parent\n");
++
++ if(parent == NULL) {
++ rv = ERR_PTR(-EACCES);
++ goto out;
++ }
++
++ rv = d_alloc_anon(parent);
++ if(rv == NULL)
++ rv = ERR_PTR(-ENOMEM);
++
++out:
++ return rv;
++}
++
++
++SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct inode *i = iget_locked(s, inode_number);
++
++ TRACE("Entered squashfs_iget\n");
++
++ if(i && (i->i_state & I_NEW)) {
++ (msblk->read_inode)(i, inode);
++ unlock_new_inode(i);
++ }
++
++ return i;
++}
++
++
++static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode)
++{
++ struct super_block *s = i->i_sb;
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ long long block = SQUASHFS_INODE_BLK(inode) +
++ sblk->inode_table_start;
++ unsigned int offset = SQUASHFS_INODE_OFFSET(inode);
++ long long next_block;
++ unsigned int next_offset;
++ union squashfs_inode_header id, sid;
++ struct squashfs_base_inode_header *inodeb = &id.base,
++ *sinodeb = &sid.base;
++
++ TRACE("Entered squashfs_read_inode\n");
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *) sinodeb, block,
++ offset, sizeof(*sinodeb), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_BASE_INODE_HEADER(inodeb, sinodeb,
++ sizeof(*sinodeb));
++ } else
++ if (!squashfs_get_cached_block(s, (char *) inodeb, block,
++ offset, sizeof(*inodeb), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ squashfs_new_inode(msblk, i, inodeb);
++
++ switch(inodeb->inode_type) {
++ case SQUASHFS_FILE_TYPE: {
++ unsigned int frag_size;
++ long long frag_blk;
++ struct squashfs_reg_inode_header *inodep = &id.reg;
++ struct squashfs_reg_inode_header *sinodep = &sid.reg;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_REG_INODE_HEADER(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ frag_blk = SQUASHFS_INVALID_BLK;
++ if (inodep->fragment != SQUASHFS_INVALID_FRAG &&
++ !get_fragment_location(s,
++ inodep->fragment, &frag_blk, &frag_size))
++ goto failed_read;
++
++ i->i_nlink = 1;
++ i->i_size = inodep->file_size;
++ i->i_fop = &generic_ro_fops;
++ i->i_mode |= S_IFREG;
++ i->i_blocks = ((i->i_size - 1) >> 9) + 1;
++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->u.s1.block_list_start = next_block;
++ SQUASHFS_I(i)->offset = next_offset;
++ if (sblk->block_size > 4096)
++ i->i_data.a_ops = &squashfs_aops;
++ else
++ i->i_data.a_ops = &squashfs_aops_4K;
++
++ TRACE("File inode %x:%x, start_block %llx, "
++ "block_list_start %llx, offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->start_block, next_block,
++ next_offset);
++ break;
++ }
++ case SQUASHFS_LREG_TYPE: {
++ unsigned int frag_size;
++ long long frag_blk;
++ struct squashfs_lreg_inode_header *inodep = &id.lreg;
++ struct squashfs_lreg_inode_header *sinodep = &sid.lreg;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_LREG_INODE_HEADER(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ frag_blk = SQUASHFS_INVALID_BLK;
++ if (inodep->fragment != SQUASHFS_INVALID_FRAG &&
++ !get_fragment_location(s,
++ inodep->fragment, &frag_blk, &frag_size))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_size = inodep->file_size;
++ i->i_fop = &generic_ro_fops;
++ i->i_mode |= S_IFREG;
++ i->i_blocks = ((i->i_size - 1) >> 9) + 1;
++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->u.s1.block_list_start = next_block;
++ SQUASHFS_I(i)->offset = next_offset;
++ if (sblk->block_size > 4096)
++ i->i_data.a_ops = &squashfs_aops;
++ else
++ i->i_data.a_ops = &squashfs_aops_4K;
++
++ TRACE("File inode %x:%x, start_block %llx, "
++ "block_list_start %llx, offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->start_block, next_block,
++ next_offset);
++ break;
++ }
++ case SQUASHFS_DIR_TYPE: {
++ struct squashfs_dir_inode_header *inodep = &id.dir;
++ struct squashfs_dir_inode_header *sinodep = &sid.dir;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_DIR_INODE_HEADER(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_size = inodep->file_size;
++ i->i_op = &squashfs_dir_inode_ops;
++ i->i_fop = &squashfs_dir_ops;
++ i->i_mode |= S_IFDIR;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->offset = inodep->offset;
++ SQUASHFS_I(i)->u.s2.directory_index_count = 0;
++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode;
++
++ TRACE("Directory inode %x:%x, start_block %x, offset "
++ "%x\n", SQUASHFS_INODE_BLK(inode),
++ offset, inodep->start_block,
++ inodep->offset);
++ break;
++ }
++ case SQUASHFS_LDIR_TYPE: {
++ struct squashfs_ldir_inode_header *inodep = &id.ldir;
++ struct squashfs_ldir_inode_header *sinodep = &sid.ldir;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_LDIR_INODE_HEADER(inodep,
++ sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_size = inodep->file_size;
++ i->i_op = &squashfs_dir_inode_ops;
++ i->i_fop = &squashfs_dir_ops;
++ i->i_mode |= S_IFDIR;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->offset = inodep->offset;
++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block;
++ SQUASHFS_I(i)->u.s2.directory_index_offset =
++ next_offset;
++ SQUASHFS_I(i)->u.s2.directory_index_count =
++ inodep->i_count;
++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode;
++
++ TRACE("Long directory inode %x:%x, start_block %x, "
++ "offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->start_block, inodep->offset);
++ break;
++ }
++ case SQUASHFS_SYMLINK_TYPE: {
++ struct squashfs_symlink_inode_header *inodep =
++ &id.symlink;
++ struct squashfs_symlink_inode_header *sinodep =
++ &sid.symlink;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER(inodep,
++ sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_size = inodep->symlink_size;
++ i->i_op = &page_symlink_inode_operations;
++ i->i_data.a_ops = &squashfs_symlink_aops;
++ i->i_mode |= S_IFLNK;
++ SQUASHFS_I(i)->start_block = next_block;
++ SQUASHFS_I(i)->offset = next_offset;
++
++ TRACE("Symbolic link inode %x:%x, start_block %llx, "
++ "offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ next_block, next_offset);
++ break;
++ }
++ case SQUASHFS_BLKDEV_TYPE:
++ case SQUASHFS_CHRDEV_TYPE: {
++ struct squashfs_dev_inode_header *inodep = &id.dev;
++ struct squashfs_dev_inode_header *sinodep = &sid.dev;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_DEV_INODE_HEADER(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_mode |= (inodeb->inode_type ==
++ SQUASHFS_CHRDEV_TYPE) ? S_IFCHR :
++ S_IFBLK;
++ init_special_inode(i, i->i_mode,
++ old_decode_dev(inodep->rdev));
++
++ TRACE("Device inode %x:%x, rdev %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->rdev);
++ break;
++ }
++ case SQUASHFS_FIFO_TYPE:
++ case SQUASHFS_SOCKET_TYPE: {
++ struct squashfs_ipc_inode_header *inodep = &id.ipc;
++ struct squashfs_ipc_inode_header *sinodep = &sid.ipc;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_IPC_INODE_HEADER(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_nlink = inodep->nlink;
++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE)
++ ? S_IFIFO : S_IFSOCK;
++ init_special_inode(i, i->i_mode, 0);
++ break;
++ }
++ default:
++ ERROR("Unknown inode type %d in squashfs_iget!\n",
++ inodeb->inode_type);
++ goto failed_read1;
++ }
++
++ return 1;
++
++failed_read:
++ ERROR("Unable to read inode [%llx:%x]\n", block, offset);
++
++failed_read1:
++ make_bad_inode(i);
++ return 0;
++}
++
++
++static int read_inode_lookup_table(struct super_block *s)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ unsigned int length = SQUASHFS_LOOKUP_BLOCK_BYTES(sblk->inodes);
++
++ TRACE("In read_inode_lookup_table, length %d\n", length);
++
++ /* Allocate inode lookup table */
++ if (!(msblk->inode_lookup_table = kmalloc(length, GFP_KERNEL))) {
++ ERROR("Failed to allocate inode lookup table\n");
++ return 0;
++ }
++
++ if (!squashfs_read_data(s, (char *) msblk->inode_lookup_table,
++ sblk->lookup_table_start, length |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) {
++ ERROR("unable to read inode lookup table\n");
++ return 0;
++ }
++
++ if (msblk->swap) {
++ int i;
++ long long block;
++
++ for (i = 0; i < SQUASHFS_LOOKUP_BLOCKS(sblk->inodes); i++) {
++ SQUASHFS_SWAP_LOOKUP_BLOCKS((&block),
++ &msblk->inode_lookup_table[i], 1);
++ msblk->inode_lookup_table[i] = block;
++ }
++ }
++
++ return 1;
++}
++
++
++static int read_fragment_index_table(struct super_block *s)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ unsigned int length = SQUASHFS_FRAGMENT_INDEX_BYTES(sblk->fragments);
++
++ if(length == 0)
++ return 1;
++
++ /* Allocate fragment index table */
++ if (!(msblk->fragment_index = kmalloc(length, GFP_KERNEL))) {
++ ERROR("Failed to allocate fragment index table\n");
++ return 0;
++ }
++
++ if (!squashfs_read_data(s, (char *) msblk->fragment_index,
++ sblk->fragment_table_start, length |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) {
++ ERROR("unable to read fragment index table\n");
++ return 0;
++ }
++
++ if (msblk->swap) {
++ int i;
++ long long fragment;
++
++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES(sblk->fragments); i++) {
++ SQUASHFS_SWAP_FRAGMENT_INDEXES((&fragment),
++ &msblk->fragment_index[i], 1);
++ msblk->fragment_index[i] = fragment;
++ }
++ }
++
++ return 1;
++}
++
++
++static int supported_squashfs_filesystem(struct squashfs_sb_info *msblk, int silent)
++{
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ msblk->read_inode = squashfs_read_inode;
++ msblk->read_blocklist = read_blocklist;
++ msblk->read_fragment_index_table = read_fragment_index_table;
++
++ if (sblk->s_major == 1) {
++ if (!squashfs_1_0_supported(msblk)) {
++ SERROR("Major/Minor mismatch, Squashfs 1.0 filesystems "
++ "are unsupported\n");
++ SERROR("Please recompile with "
++ "Squashfs 1.0 support enabled\n");
++ return 0;
++ }
++ } else if (sblk->s_major == 2) {
++ if (!squashfs_2_0_supported(msblk)) {
++ SERROR("Major/Minor mismatch, Squashfs 2.0 filesystems "
++ "are unsupported\n");
++ SERROR("Please recompile with "
++ "Squashfs 2.0 support enabled\n");
++ return 0;
++ }
++ } else if(sblk->s_major != SQUASHFS_MAJOR || sblk->s_minor >
++ SQUASHFS_MINOR) {
++ SERROR("Major/Minor mismatch, trying to mount newer %d.%d "
++ "filesystem\n", sblk->s_major, sblk->s_minor);
++ SERROR("Please update your kernel\n");
++ return 0;
++ }
++
++ return 1;
++}
++
++
++static int squashfs_fill_super(struct super_block *s, void *data, int silent)
++{
++ struct squashfs_sb_info *msblk;
++ struct squashfs_super_block *sblk;
++ int i;
++ char b[BDEVNAME_SIZE];
++ struct inode *root;
++
++ TRACE("Entered squashfs_read_superblock\n");
++
++ if (!(s->s_fs_info = kmalloc(sizeof(struct squashfs_sb_info),
++ GFP_KERNEL))) {
++ ERROR("Failed to allocate superblock\n");
++ goto failure;
++ }
++ memset(s->s_fs_info, 0, sizeof(struct squashfs_sb_info));
++ msblk = s->s_fs_info;
++ if (!(msblk->stream.workspace = vmalloc(zlib_inflate_workspacesize()))) {
++ ERROR("Failed to allocate zlib workspace\n");
++ goto failure;
++ }
++ sblk = &msblk->sblk;
++
++ msblk->devblksize = sb_min_blocksize(s, BLOCK_SIZE);
++ msblk->devblksize_log2 = ffz(~msblk->devblksize);
++
++ mutex_init(&msblk->read_data_mutex);
++ mutex_init(&msblk->read_page_mutex);
++ mutex_init(&msblk->block_cache_mutex);
++ mutex_init(&msblk->fragment_mutex);
++ mutex_init(&msblk->meta_index_mutex);
++
++ init_waitqueue_head(&msblk->waitq);
++ init_waitqueue_head(&msblk->fragment_wait_queue);
++
++ sblk->bytes_used = sizeof(struct squashfs_super_block);
++ if (!squashfs_read_data(s, (char *) sblk, SQUASHFS_START,
++ sizeof(struct squashfs_super_block) |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, sizeof(struct squashfs_super_block))) {
++ SERROR("unable to read superblock\n");
++ goto failed_mount;
++ }
++
++ /* Check it is a SQUASHFS superblock */
++ msblk->swap = 0;
++ if ((s->s_magic = sblk->s_magic) != SQUASHFS_MAGIC) {
++ if (sblk->s_magic == SQUASHFS_MAGIC_SWAP) {
++ struct squashfs_super_block ssblk;
++
++ WARNING("Mounting a different endian SQUASHFS "
++ "filesystem on %s\n", bdevname(s->s_bdev, b));
++
++ SQUASHFS_SWAP_SUPER_BLOCK(&ssblk, sblk);
++ memcpy(sblk, &ssblk, sizeof(struct squashfs_super_block));
++ msblk->swap = 1;
++ } else {
++ SERROR("Can't find a SQUASHFS superblock on %s\n",
++ bdevname(s->s_bdev, b));
++ goto failed_mount;
++ }
++ }
++
++ /* Check the MAJOR & MINOR versions */
++ if(!supported_squashfs_filesystem(msblk, silent))
++ goto failed_mount;
++
++ /* Check the filesystem does not extend beyond the end of the
++ block device */
++ if(sblk->bytes_used < 0 || sblk->bytes_used > i_size_read(s->s_bdev->bd_inode))
++ goto failed_mount;
++
++ /* Check the root inode for sanity */
++ if (SQUASHFS_INODE_OFFSET(sblk->root_inode) > SQUASHFS_METADATA_SIZE)
++ goto failed_mount;
++
++ TRACE("Found valid superblock on %s\n", bdevname(s->s_bdev, b));
++ TRACE("Inodes are %scompressed\n",
++ SQUASHFS_UNCOMPRESSED_INODES
++ (sblk->flags) ? "un" : "");
++ TRACE("Data is %scompressed\n",
++ SQUASHFS_UNCOMPRESSED_DATA(sblk->flags)
++ ? "un" : "");
++ TRACE("Check data is %s present in the filesystem\n",
++ SQUASHFS_CHECK_DATA(sblk->flags) ?
++ "" : "not");
++ TRACE("Filesystem size %lld bytes\n", sblk->bytes_used);
++ TRACE("Block size %d\n", sblk->block_size);
++ TRACE("Number of inodes %d\n", sblk->inodes);
++ if (sblk->s_major > 1)
++ TRACE("Number of fragments %d\n", sblk->fragments);
++ TRACE("Number of uids %d\n", sblk->no_uids);
++ TRACE("Number of gids %d\n", sblk->no_guids);
++ TRACE("sblk->inode_table_start %llx\n", sblk->inode_table_start);
++ TRACE("sblk->directory_table_start %llx\n", sblk->directory_table_start);
++ if (sblk->s_major > 1)
++ TRACE("sblk->fragment_table_start %llx\n",
++ sblk->fragment_table_start);
++ TRACE("sblk->uid_start %llx\n", sblk->uid_start);
++
++ s->s_flags |= MS_RDONLY;
++ s->s_op = &squashfs_super_ops;
++
++ /* Init inode_table block pointer array */
++ if (!(msblk->block_cache = kmalloc(sizeof(struct squashfs_cache) *
++ SQUASHFS_CACHED_BLKS, GFP_KERNEL))) {
++ ERROR("Failed to allocate block cache\n");
++ goto failed_mount;
++ }
++
++ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
++ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK;
++
++ msblk->next_cache = 0;
++
++ /* Allocate read_page block */
++ if (!(msblk->read_page = kmalloc(sblk->block_size, GFP_KERNEL))) {
++ ERROR("Failed to allocate read_page block\n");
++ goto failed_mount;
++ }
++
++ /* Allocate uid and gid tables */
++ if (!(msblk->uid = kmalloc((sblk->no_uids + sblk->no_guids) *
++ sizeof(unsigned int), GFP_KERNEL))) {
++ ERROR("Failed to allocate uid/gid table\n");
++ goto failed_mount;
++ }
++ msblk->guid = msblk->uid + sblk->no_uids;
++
++ if (msblk->swap) {
++ unsigned int suid[sblk->no_uids + sblk->no_guids];
++
++ if (!squashfs_read_data(s, (char *) &suid, sblk->uid_start,
++ ((sblk->no_uids + sblk->no_guids) *
++ sizeof(unsigned int)) |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) {
++ ERROR("unable to read uid/gid table\n");
++ goto failed_mount;
++ }
++
++ SQUASHFS_SWAP_DATA(msblk->uid, suid, (sblk->no_uids +
++ sblk->no_guids), (sizeof(unsigned int) * 8));
++ } else
++ if (!squashfs_read_data(s, (char *) msblk->uid, sblk->uid_start,
++ ((sblk->no_uids + sblk->no_guids) *
++ sizeof(unsigned int)) |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) {
++ ERROR("unable to read uid/gid table\n");
++ goto failed_mount;
++ }
++
++
++ if (sblk->s_major == 1 && squashfs_1_0_supported(msblk))
++ goto allocate_root;
++
++ if (!(msblk->fragment = kmalloc(sizeof(struct squashfs_fragment_cache) *
++ SQUASHFS_CACHED_FRAGMENTS, GFP_KERNEL))) {
++ ERROR("Failed to allocate fragment block cache\n");
++ goto failed_mount;
++ }
++
++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) {
++ msblk->fragment[i].locked = 0;
++ msblk->fragment[i].block = SQUASHFS_INVALID_BLK;
++ msblk->fragment[i].data = NULL;
++ }
++
++ msblk->next_fragment = 0;
++
++ /* Allocate and read fragment index table */
++ if (msblk->read_fragment_index_table(s) == 0)
++ goto failed_mount;
++
++ if(sblk->s_major < 3 || sblk->lookup_table_start == SQUASHFS_INVALID_BLK)
++ goto allocate_root;
++
++ /* Allocate and read inode lookup table */
++ if (read_inode_lookup_table(s) == 0)
++ goto failed_mount;
++
++ s->s_op = &squashfs_export_super_ops;
++ s->s_export_op = &squashfs_export_ops;
++
++allocate_root:
++ root = new_inode(s);
++ if ((msblk->read_inode)(root, sblk->root_inode) == 0)
++ goto failed_mount;
++ insert_inode_hash(root);
++
++ if ((s->s_root = d_alloc_root(root)) == NULL) {
++ ERROR("Root inode create failed\n");
++ iput(root);
++ goto failed_mount;
++ }
++
++ TRACE("Leaving squashfs_read_super\n");
++ return 0;
++
++failed_mount:
++ kfree(msblk->inode_lookup_table);
++ kfree(msblk->fragment_index);
++ kfree(msblk->fragment);
++ kfree(msblk->uid);
++ kfree(msblk->read_page);
++ kfree(msblk->block_cache);
++ kfree(msblk->fragment_index_2);
++ vfree(msblk->stream.workspace);
++ kfree(s->s_fs_info);
++ s->s_fs_info = NULL;
++ return -EINVAL;
++
++failure:
++ return -ENOMEM;
++}
++
++
++static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf)
++{
++ struct squashfs_sb_info *msblk = dentry->d_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ TRACE("Entered squashfs_statfs\n");
++
++ buf->f_type = SQUASHFS_MAGIC;
++ buf->f_bsize = sblk->block_size;
++ buf->f_blocks = ((sblk->bytes_used - 1) >> sblk->block_log) + 1;
++ buf->f_bfree = buf->f_bavail = 0;
++ buf->f_files = sblk->inodes;
++ buf->f_ffree = 0;
++ buf->f_namelen = SQUASHFS_NAME_LEN;
++
++ return 0;
++}
++
++
++static int squashfs_symlink_readpage(struct file *file, struct page *page)
++{
++ struct inode *inode = page->mapping->host;
++ int index = page->index << PAGE_CACHE_SHIFT, length, bytes;
++ long long block = SQUASHFS_I(inode)->start_block;
++ int offset = SQUASHFS_I(inode)->offset;
++ void *pageaddr = kmap(page);
++
++ TRACE("Entered squashfs_symlink_readpage, page index %ld, start block "
++ "%llx, offset %x\n", page->index,
++ SQUASHFS_I(inode)->start_block,
++ SQUASHFS_I(inode)->offset);
++
++ for (length = 0; length < index; length += bytes) {
++ if (!(bytes = squashfs_get_cached_block(inode->i_sb, NULL,
++ block, offset, PAGE_CACHE_SIZE, &block,
++ &offset))) {
++ ERROR("Unable to read symbolic link [%llx:%x]\n", block,
++ offset);
++ goto skip_read;
++ }
++ }
++
++ if (length != index) {
++ ERROR("(squashfs_symlink_readpage) length != index\n");
++ bytes = 0;
++ goto skip_read;
++ }
++
++ bytes = (i_size_read(inode) - length) > PAGE_CACHE_SIZE ? PAGE_CACHE_SIZE :
++ i_size_read(inode) - length;
++
++ if (!(bytes = squashfs_get_cached_block(inode->i_sb, pageaddr, block,
++ offset, bytes, &block, &offset)))
++ ERROR("Unable to read symbolic link [%llx:%x]\n", block, offset);
++
++skip_read:
++ memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
++ kunmap(page);
++ flush_dcache_page(page);
++ SetPageUptodate(page);
++ unlock_page(page);
++
++ return 0;
++}
++
++
++struct meta_index *locate_meta_index(struct inode *inode, int index, int offset)
++{
++ struct meta_index *meta = NULL;
++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
++ int i;
++
++ mutex_lock(&msblk->meta_index_mutex);
++
++ TRACE("locate_meta_index: index %d, offset %d\n", index, offset);
++
++ if(msblk->meta_index == NULL)
++ goto not_allocated;
++
++ for (i = 0; i < SQUASHFS_META_NUMBER; i ++)
++ if (msblk->meta_index[i].inode_number == inode->i_ino &&
++ msblk->meta_index[i].offset >= offset &&
++ msblk->meta_index[i].offset <= index &&
++ msblk->meta_index[i].locked == 0) {
++ TRACE("locate_meta_index: entry %d, offset %d\n", i,
++ msblk->meta_index[i].offset);
++ meta = &msblk->meta_index[i];
++ offset = meta->offset;
++ }
++
++ if (meta)
++ meta->locked = 1;
++
++not_allocated:
++ mutex_unlock(&msblk->meta_index_mutex);
++
++ return meta;
++}
++
++
++struct meta_index *empty_meta_index(struct inode *inode, int offset, int skip)
++{
++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
++ struct meta_index *meta = NULL;
++ int i;
++
++ mutex_lock(&msblk->meta_index_mutex);
++
++ TRACE("empty_meta_index: offset %d, skip %d\n", offset, skip);
++
++ if(msblk->meta_index == NULL) {
++ if (!(msblk->meta_index = kmalloc(sizeof(struct meta_index) *
++ SQUASHFS_META_NUMBER, GFP_KERNEL))) {
++ ERROR("Failed to allocate meta_index\n");
++ goto failed;
++ }
++ for(i = 0; i < SQUASHFS_META_NUMBER; i++) {
++ msblk->meta_index[i].inode_number = 0;
++ msblk->meta_index[i].locked = 0;
++ }
++ msblk->next_meta_index = 0;
++ }
++
++ for(i = SQUASHFS_META_NUMBER; i &&
++ msblk->meta_index[msblk->next_meta_index].locked; i --)
++ msblk->next_meta_index = (msblk->next_meta_index + 1) %
++ SQUASHFS_META_NUMBER;
++
++ if(i == 0) {
++ TRACE("empty_meta_index: failed!\n");
++ goto failed;
++ }
++
++ TRACE("empty_meta_index: returned meta entry %d, %p\n",
++ msblk->next_meta_index,
++ &msblk->meta_index[msblk->next_meta_index]);
++
++ meta = &msblk->meta_index[msblk->next_meta_index];
++ msblk->next_meta_index = (msblk->next_meta_index + 1) %
++ SQUASHFS_META_NUMBER;
++
++ meta->inode_number = inode->i_ino;
++ meta->offset = offset;
++ meta->skip = skip;
++ meta->entries = 0;
++ meta->locked = 1;
++
++failed:
++ mutex_unlock(&msblk->meta_index_mutex);
++ return meta;
++}
++
++
++void release_meta_index(struct inode *inode, struct meta_index *meta)
++{
++ meta->locked = 0;
++ smp_mb();
++}
++
++
++static int read_block_index(struct super_block *s, int blocks, char *block_list,
++ long long *start_block, int *offset)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ unsigned int *block_listp;
++ int block = 0;
++
++ if (msblk->swap) {
++ char sblock_list[blocks << 2];
++
++ if (!squashfs_get_cached_block(s, sblock_list, *start_block,
++ *offset, blocks << 2, start_block, offset)) {
++ ERROR("Unable to read block list [%llx:%x]\n",
++ *start_block, *offset);
++ goto failure;
++ }
++ SQUASHFS_SWAP_INTS(((unsigned int *)block_list),
++ ((unsigned int *)sblock_list), blocks);
++ } else
++ if (!squashfs_get_cached_block(s, block_list, *start_block,
++ *offset, blocks << 2, start_block, offset)) {
++ ERROR("Unable to read block list [%llx:%x]\n",
++ *start_block, *offset);
++ goto failure;
++ }
++
++ for (block_listp = (unsigned int *) block_list; blocks;
++ block_listp++, blocks --)
++ block += SQUASHFS_COMPRESSED_SIZE_BLOCK(*block_listp);
++
++ return block;
++
++failure:
++ return -1;
++}
++
++
++#define SIZE 256
++
++static inline int calculate_skip(int blocks) {
++ int skip = (blocks - 1) / ((SQUASHFS_SLOTS * SQUASHFS_META_ENTRIES + 1) * SQUASHFS_META_INDEXES);
++ return skip >= 7 ? 7 : skip + 1;
++}
++
++
++static int get_meta_index(struct inode *inode, int index,
++ long long *index_block, int *index_offset,
++ long long *data_block, char *block_list)
++{
++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ int skip = calculate_skip(i_size_read(inode) >> sblk->block_log);
++ int offset = 0;
++ struct meta_index *meta;
++ struct meta_entry *meta_entry;
++ long long cur_index_block = SQUASHFS_I(inode)->u.s1.block_list_start;
++ int cur_offset = SQUASHFS_I(inode)->offset;
++ long long cur_data_block = SQUASHFS_I(inode)->start_block;
++ int i;
++
++ index /= SQUASHFS_META_INDEXES * skip;
++
++ while ( offset < index ) {
++ meta = locate_meta_index(inode, index, offset + 1);
++
++ if (meta == NULL) {
++ if ((meta = empty_meta_index(inode, offset + 1,
++ skip)) == NULL)
++ goto all_done;
++ } else {
++ if(meta->entries == 0)
++ goto failed;
++ offset = index < meta->offset + meta->entries ? index :
++ meta->offset + meta->entries - 1;
++ meta_entry = &meta->meta_entry[offset - meta->offset];
++ cur_index_block = meta_entry->index_block + sblk->inode_table_start;
++ cur_offset = meta_entry->offset;
++ cur_data_block = meta_entry->data_block;
++ TRACE("get_meta_index: offset %d, meta->offset %d, "
++ "meta->entries %d\n", offset, meta->offset,
++ meta->entries);
++ TRACE("get_meta_index: index_block 0x%llx, offset 0x%x"
++ " data_block 0x%llx\n", cur_index_block,
++ cur_offset, cur_data_block);
++ }
++
++ for (i = meta->offset + meta->entries; i <= index &&
++ i < meta->offset + SQUASHFS_META_ENTRIES; i++) {
++ int blocks = skip * SQUASHFS_META_INDEXES;
++
++ while (blocks) {
++ int block = blocks > (SIZE >> 2) ? (SIZE >> 2) :
++ blocks;
++ int res = read_block_index(inode->i_sb, block,
++ block_list, &cur_index_block,
++ &cur_offset);
++
++ if (res == -1)
++ goto failed;
++
++ cur_data_block += res;
++ blocks -= block;
++ }
++
++ meta_entry = &meta->meta_entry[i - meta->offset];
++ meta_entry->index_block = cur_index_block - sblk->inode_table_start;
++ meta_entry->offset = cur_offset;
++ meta_entry->data_block = cur_data_block;
++ meta->entries ++;
++ offset ++;
++ }
++
++ TRACE("get_meta_index: meta->offset %d, meta->entries %d\n",
++ meta->offset, meta->entries);
++
++ release_meta_index(inode, meta);
++ }
++
++all_done:
++ *index_block = cur_index_block;
++ *index_offset = cur_offset;
++ *data_block = cur_data_block;
++
++ return offset * SQUASHFS_META_INDEXES * skip;
++
++failed:
++ release_meta_index(inode, meta);
++ return -1;
++}
++
++
++static long long read_blocklist(struct inode *inode, int index,
++ int readahead_blks, char *block_list,
++ unsigned short **block_p, unsigned int *bsize)
++{
++ long long block_ptr;
++ int offset;
++ long long block;
++ int res = get_meta_index(inode, index, &block_ptr, &offset, &block,
++ block_list);
++
++ TRACE("read_blocklist: res %d, index %d, block_ptr 0x%llx, offset"
++ " 0x%x, block 0x%llx\n", res, index, block_ptr, offset,
++ block);
++
++ if(res == -1)
++ goto failure;
++
++ index -= res;
++
++ while ( index ) {
++ int blocks = index > (SIZE >> 2) ? (SIZE >> 2) : index;
++ int res = read_block_index(inode->i_sb, blocks, block_list,
++ &block_ptr, &offset);
++ if (res == -1)
++ goto failure;
++ block += res;
++ index -= blocks;
++ }
++
++ if (read_block_index(inode->i_sb, 1, block_list,
++ &block_ptr, &offset) == -1)
++ goto failure;
++ *bsize = *((unsigned int *) block_list);
++
++ return block;
++
++failure:
++ return 0;
++}
++
++
++static int squashfs_readpage(struct file *file, struct page *page)
++{
++ struct inode *inode = page->mapping->host;
++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ unsigned char *block_list;
++ long long block;
++ unsigned int bsize, i = 0, bytes = 0, byte_offset = 0;
++ int index = page->index >> (sblk->block_log - PAGE_CACHE_SHIFT);
++ void *pageaddr;
++ struct squashfs_fragment_cache *fragment = NULL;
++ char *data_ptr = msblk->read_page;
++
++ int mask = (1 << (sblk->block_log - PAGE_CACHE_SHIFT)) - 1;
++ int start_index = page->index & ~mask;
++ int end_index = start_index | mask;
++
++ TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n",
++ page->index,
++ SQUASHFS_I(inode)->start_block);
++
++ if (!(block_list = kmalloc(SIZE, GFP_KERNEL))) {
++ ERROR("Failed to allocate block_list\n");
++ goto skip_read;
++ }
++
++ if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >>
++ PAGE_CACHE_SHIFT))
++ goto skip_read;
++
++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK
++ || index < (i_size_read(inode) >>
++ sblk->block_log)) {
++ if ((block = (msblk->read_blocklist)(inode, index, 1,
++ block_list, NULL, &bsize)) == 0)
++ goto skip_read;
++
++ mutex_lock(&msblk->read_page_mutex);
++
++ if (!(bytes = squashfs_read_data(inode->i_sb, msblk->read_page,
++ block, bsize, NULL, sblk->block_size))) {
++ ERROR("Unable to read page, block %llx, size %x\n", block,
++ bsize);
++ mutex_unlock(&msblk->read_page_mutex);
++ goto skip_read;
++ }
++ } else {
++ if ((fragment = get_cached_fragment(inode->i_sb,
++ SQUASHFS_I(inode)->
++ u.s1.fragment_start_block,
++ SQUASHFS_I(inode)->u.s1.fragment_size))
++ == NULL) {
++ ERROR("Unable to read page, block %llx, size %x\n",
++ SQUASHFS_I(inode)->
++ u.s1.fragment_start_block,
++ (int) SQUASHFS_I(inode)->
++ u.s1.fragment_size);
++ goto skip_read;
++ }
++ bytes = SQUASHFS_I(inode)->u.s1.fragment_offset +
++ (i_size_read(inode) & (sblk->block_size
++ - 1));
++ byte_offset = SQUASHFS_I(inode)->u.s1.fragment_offset;
++ data_ptr = fragment->data;
++ }
++
++ for (i = start_index; i <= end_index && byte_offset < bytes;
++ i++, byte_offset += PAGE_CACHE_SIZE) {
++ struct page *push_page;
++ int avail = (bytes - byte_offset) > PAGE_CACHE_SIZE ?
++ PAGE_CACHE_SIZE : bytes - byte_offset;
++
++ TRACE("bytes %d, i %d, byte_offset %d, available_bytes %d\n",
++ bytes, i, byte_offset, avail);
++
++ push_page = (i == page->index) ? page :
++ grab_cache_page_nowait(page->mapping, i);
++
++ if (!push_page)
++ continue;
++
++ if (PageUptodate(push_page))
++ goto skip_page;
++
++ pageaddr = kmap_atomic(push_page, KM_USER0);
++ memcpy(pageaddr, data_ptr + byte_offset, avail);
++ memset(pageaddr + avail, 0, PAGE_CACHE_SIZE - avail);
++ kunmap_atomic(pageaddr, KM_USER0);
++ flush_dcache_page(push_page);
++ SetPageUptodate(push_page);
++skip_page:
++ unlock_page(push_page);
++ if(i != page->index)
++ page_cache_release(push_page);
++ }
++
++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK
++ || index < (i_size_read(inode) >>
++ sblk->block_log))
++ mutex_unlock(&msblk->read_page_mutex);
++ else
++ release_cached_fragment(msblk, fragment);
++
++ kfree(block_list);
++ return 0;
++
++skip_read:
++ pageaddr = kmap_atomic(page, KM_USER0);
++ memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
++ kunmap_atomic(pageaddr, KM_USER0);
++ flush_dcache_page(page);
++ SetPageUptodate(page);
++ unlock_page(page);
++
++ kfree(block_list);
++ return 0;
++}
++
++
++static int squashfs_readpage4K(struct file *file, struct page *page)
++{
++ struct inode *inode = page->mapping->host;
++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ unsigned char *block_list;
++ long long block;
++ unsigned int bsize, bytes = 0;
++ void *pageaddr;
++
++ TRACE("Entered squashfs_readpage4K, page index %lx, start block %llx\n",
++ page->index,
++ SQUASHFS_I(inode)->start_block);
++
++ if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >>
++ PAGE_CACHE_SHIFT)) {
++ block_list = NULL;
++ goto skip_read;
++ }
++
++ if (!(block_list = kmalloc(SIZE, GFP_KERNEL))) {
++ ERROR("Failed to allocate block_list\n");
++ goto skip_read;
++ }
++
++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK
++ || page->index < (i_size_read(inode) >>
++ sblk->block_log)) {
++ block = (msblk->read_blocklist)(inode, page->index, 1,
++ block_list, NULL, &bsize);
++ if(block == 0)
++ goto skip_read;
++
++ mutex_lock(&msblk->read_page_mutex);
++ bytes = squashfs_read_data(inode->i_sb, msblk->read_page, block,
++ bsize, NULL, sblk->block_size);
++ if (bytes) {
++ pageaddr = kmap_atomic(page, KM_USER0);
++ memcpy(pageaddr, msblk->read_page, bytes);
++ kunmap_atomic(pageaddr, KM_USER0);
++ } else
++ ERROR("Unable to read page, block %llx, size %x\n",
++ block, bsize);
++ mutex_unlock(&msblk->read_page_mutex);
++ } else {
++ struct squashfs_fragment_cache *fragment =
++ get_cached_fragment(inode->i_sb,
++ SQUASHFS_I(inode)->
++ u.s1.fragment_start_block,
++ SQUASHFS_I(inode)-> u.s1.fragment_size);
++ if (fragment) {
++ bytes = i_size_read(inode) & (sblk->block_size - 1);
++ pageaddr = kmap_atomic(page, KM_USER0);
++ memcpy(pageaddr, fragment->data + SQUASHFS_I(inode)->
++ u.s1.fragment_offset, bytes);
++ kunmap_atomic(pageaddr, KM_USER0);
++ release_cached_fragment(msblk, fragment);
++ } else
++ ERROR("Unable to read page, block %llx, size %x\n",
++ SQUASHFS_I(inode)->
++ u.s1.fragment_start_block, (int)
++ SQUASHFS_I(inode)-> u.s1.fragment_size);
++ }
++
++skip_read:
++ pageaddr = kmap_atomic(page, KM_USER0);
++ memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
++ kunmap_atomic(pageaddr, KM_USER0);
++ flush_dcache_page(page);
++ SetPageUptodate(page);
++ unlock_page(page);
++
++ kfree(block_list);
++ return 0;
++}
++
++
++static int get_dir_index_using_offset(struct super_block *s, long long
++ *next_block, unsigned int *next_offset,
++ long long index_start,
++ unsigned int index_offset, int i_count,
++ long long f_pos)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ int i, length = 0;
++ struct squashfs_dir_index index;
++
++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n",
++ i_count, (unsigned int) f_pos);
++
++ f_pos =- 3;
++ if (f_pos == 0)
++ goto finish;
++
++ for (i = 0; i < i_count; i++) {
++ if (msblk->swap) {
++ struct squashfs_dir_index sindex;
++ squashfs_get_cached_block(s, (char *) &sindex,
++ index_start, index_offset,
++ sizeof(sindex), &index_start,
++ &index_offset);
++ SQUASHFS_SWAP_DIR_INDEX(&index, &sindex);
++ } else
++ squashfs_get_cached_block(s, (char *) &index,
++ index_start, index_offset,
++ sizeof(index), &index_start,
++ &index_offset);
++
++ if (index.index > f_pos)
++ break;
++
++ squashfs_get_cached_block(s, NULL, index_start, index_offset,
++ index.size + 1, &index_start,
++ &index_offset);
++
++ length = index.index;
++ *next_block = index.start_block + sblk->directory_table_start;
++ }
++
++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
++
++finish:
++ return length + 3;
++}
++
++
++static int get_dir_index_using_name(struct super_block *s, long long
++ *next_block, unsigned int *next_offset,
++ long long index_start,
++ unsigned int index_offset, int i_count,
++ const char *name, int size)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ int i, length = 0;
++ struct squashfs_dir_index *index;
++ char *str;
++
++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count);
++
++ if (!(str = kmalloc(sizeof(struct squashfs_dir_index) +
++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_index\n");
++ goto failure;
++ }
++
++ index = (struct squashfs_dir_index *) (str + SQUASHFS_NAME_LEN + 1);
++ strncpy(str, name, size);
++ str[size] = '\0';
++
++ for (i = 0; i < i_count; i++) {
++ if (msblk->swap) {
++ struct squashfs_dir_index sindex;
++ squashfs_get_cached_block(s, (char *) &sindex,
++ index_start, index_offset,
++ sizeof(sindex), &index_start,
++ &index_offset);
++ SQUASHFS_SWAP_DIR_INDEX(index, &sindex);
++ } else
++ squashfs_get_cached_block(s, (char *) index,
++ index_start, index_offset,
++ sizeof(struct squashfs_dir_index),
++ &index_start, &index_offset);
++
++ squashfs_get_cached_block(s, index->name, index_start,
++ index_offset, index->size + 1,
++ &index_start, &index_offset);
++
++ index->name[index->size + 1] = '\0';
++
++ if (strcmp(index->name, str) > 0)
++ break;
++
++ length = index->index;
++ *next_block = index->start_block + sblk->directory_table_start;
++ }
++
++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
++ kfree(str);
++failure:
++ return length + 3;
++}
++
++
++static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
++{
++ struct inode *i = file->f_dentry->d_inode;
++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ long long next_block = SQUASHFS_I(i)->start_block +
++ sblk->directory_table_start;
++ int next_offset = SQUASHFS_I(i)->offset, length = 0,
++ dir_count;
++ struct squashfs_dir_header dirh;
++ struct squashfs_dir_entry *dire;
++
++ TRACE("Entered squashfs_readdir [%llx:%x]\n", next_block, next_offset);
++
++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) +
++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_entry\n");
++ goto finish;
++ }
++
++ while(file->f_pos < 3) {
++ char *name;
++ int size, i_ino;
++
++ if(file->f_pos == 0) {
++ name = ".";
++ size = 1;
++ i_ino = i->i_ino;
++ } else {
++ name = "..";
++ size = 2;
++ i_ino = SQUASHFS_I(i)->u.s2.parent_inode;
++ }
++ TRACE("Calling filldir(%x, %s, %d, %d, %d, %d)\n",
++ (unsigned int) dirent, name, size, (int)
++ file->f_pos, i_ino,
++ squashfs_filetype_table[1]);
++
++ if (filldir(dirent, name, size,
++ file->f_pos, i_ino,
++ squashfs_filetype_table[1]) < 0) {
++ TRACE("Filldir returned less than 0\n");
++ goto finish;
++ }
++ file->f_pos += size;
++ }
++
++ length = get_dir_index_using_offset(i->i_sb, &next_block, &next_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_start,
++ SQUASHFS_I(i)->u.s2.directory_index_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_count,
++ file->f_pos);
++
++ while (length < i_size_read(i)) {
++ /* read directory header */
++ if (msblk->swap) {
++ struct squashfs_dir_header sdirh;
++
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
++ next_block, next_offset, sizeof(sdirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdirh);
++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh,
++ next_block, next_offset, sizeof(dirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(dirh);
++ }
++
++ dir_count = dirh.count + 1;
++ while (dir_count--) {
++ if (msblk->swap) {
++ struct squashfs_dir_entry sdire;
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ &sdire, next_block, next_offset,
++ sizeof(sdire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdire);
++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ dire, next_block, next_offset,
++ sizeof(*dire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(*dire);
++ }
++
++ if (!squashfs_get_cached_block(i->i_sb, dire->name,
++ next_block, next_offset,
++ dire->size + 1, &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += dire->size + 1;
++
++ if (file->f_pos >= length)
++ continue;
++
++ dire->name[dire->size + 1] = '\0';
++
++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d, %d)\n",
++ (unsigned int) dirent, dire->name,
++ dire->size + 1, (int) file->f_pos,
++ dirh.start_block, dire->offset,
++ dirh.inode_number + dire->inode_number,
++ squashfs_filetype_table[dire->type]);
++
++ if (filldir(dirent, dire->name, dire->size + 1,
++ file->f_pos,
++ dirh.inode_number + dire->inode_number,
++ squashfs_filetype_table[dire->type])
++ < 0) {
++ TRACE("Filldir returned less than 0\n");
++ goto finish;
++ }
++ file->f_pos = length;
++ }
++ }
++
++finish:
++ kfree(dire);
++ return 0;
++
++failed_read:
++ ERROR("Unable to read directory block [%llx:%x]\n", next_block,
++ next_offset);
++ kfree(dire);
++ return 0;
++}
++
++
++static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry,
++ struct nameidata *nd)
++{
++ const unsigned char *name = dentry->d_name.name;
++ int len = dentry->d_name.len;
++ struct inode *inode = NULL;
++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ long long next_block = SQUASHFS_I(i)->start_block +
++ sblk->directory_table_start;
++ int next_offset = SQUASHFS_I(i)->offset, length = 0,
++ dir_count;
++ struct squashfs_dir_header dirh;
++ struct squashfs_dir_entry *dire;
++
++ TRACE("Entered squashfs_lookup [%llx:%x]\n", next_block, next_offset);
++
++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) +
++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_entry\n");
++ goto exit_lookup;
++ }
++
++ if (len > SQUASHFS_NAME_LEN)
++ goto exit_lookup;
++
++ length = get_dir_index_using_name(i->i_sb, &next_block, &next_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_start,
++ SQUASHFS_I(i)->u.s2.directory_index_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_count, name,
++ len);
++
++ while (length < i_size_read(i)) {
++ /* read directory header */
++ if (msblk->swap) {
++ struct squashfs_dir_header sdirh;
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
++ next_block, next_offset, sizeof(sdirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdirh);
++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh,
++ next_block, next_offset, sizeof(dirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(dirh);
++ }
++
++ dir_count = dirh.count + 1;
++ while (dir_count--) {
++ if (msblk->swap) {
++ struct squashfs_dir_entry sdire;
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ &sdire, next_block,next_offset,
++ sizeof(sdire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdire);
++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ dire, next_block,next_offset,
++ sizeof(*dire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(*dire);
++ }
++
++ if (!squashfs_get_cached_block(i->i_sb, dire->name,
++ next_block, next_offset, dire->size + 1,
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += dire->size + 1;
++
++ if (name[0] < dire->name[0])
++ goto exit_lookup;
++
++ if ((len == dire->size + 1) && !strncmp(name, dire->name, len)) {
++ squashfs_inode_t ino = SQUASHFS_MKINODE(dirh.start_block,
++ dire->offset);
++
++ TRACE("calling squashfs_iget for directory "
++ "entry %s, inode %x:%x, %d\n", name,
++ dirh.start_block, dire->offset,
++ dirh.inode_number + dire->inode_number);
++
++ inode = squashfs_iget(i->i_sb, ino, dirh.inode_number + dire->inode_number);
++
++ goto exit_lookup;
++ }
++ }
++ }
++
++exit_lookup:
++ kfree(dire);
++ if (inode)
++ return d_splice_alias(inode, dentry);
++ d_add(dentry, inode);
++ return ERR_PTR(0);
++
++failed_read:
++ ERROR("Unable to read directory block [%llx:%x]\n", next_block,
++ next_offset);
++ goto exit_lookup;
++}
++
++
++static int squashfs_remount(struct super_block *s, int *flags, char *data)
++{
++ *flags |= MS_RDONLY;
++ return 0;
++}
++
++
++static void squashfs_put_super(struct super_block *s)
++{
++ int i;
++
++ if (s->s_fs_info) {
++ struct squashfs_sb_info *sbi = s->s_fs_info;
++ if (sbi->block_cache)
++ for (i = 0; i < SQUASHFS_CACHED_BLKS; i++)
++ if (sbi->block_cache[i].block !=
++ SQUASHFS_INVALID_BLK)
++ kfree(sbi->block_cache[i].data);
++ if (sbi->fragment)
++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++)
++ SQUASHFS_FREE(sbi->fragment[i].data);
++ kfree(sbi->fragment);
++ kfree(sbi->block_cache);
++ kfree(sbi->read_page);
++ kfree(sbi->uid);
++ kfree(sbi->fragment_index);
++ kfree(sbi->fragment_index_2);
++ kfree(sbi->meta_index);
++ vfree(sbi->stream.workspace);
++ kfree(s->s_fs_info);
++ s->s_fs_info = NULL;
++ }
++}
++
++
++static int squashfs_get_sb(struct file_system_type *fs_type, int flags,
++ const char *dev_name, void *data,
++ struct vfsmount *mnt)
++{
++ return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super,
++ mnt);
++}
++
++
++static int __init init_squashfs_fs(void)
++{
++ int err = init_inodecache();
++ if (err)
++ goto out;
++
++ printk(KERN_INFO "squashfs: version 3.2-r2 (2007/01/15) "
++ "Phillip Lougher\n");
++
++ if ((err = register_filesystem(&squashfs_fs_type)))
++ destroy_inodecache();
++
++out:
++ return err;
++}
++
++
++static void __exit exit_squashfs_fs(void)
++{
++ unregister_filesystem(&squashfs_fs_type);
++ destroy_inodecache();
++}
++
++
++static struct kmem_cache * squashfs_inode_cachep;
++
++
++static struct inode *squashfs_alloc_inode(struct super_block *sb)
++{
++ struct squashfs_inode_info *ei;
++ ei = kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL);
++ if (!ei)
++ return NULL;
++ return &ei->vfs_inode;
++}
++
++
++static void squashfs_destroy_inode(struct inode *inode)
++{
++ kmem_cache_free(squashfs_inode_cachep, SQUASHFS_I(inode));
++}
++
++
++static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
++{
++ struct squashfs_inode_info *ei = foo;
++
++ inode_init_once(&ei->vfs_inode);
++}
++
++
++static int __init init_inodecache(void)
++{
++ squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache",
++ sizeof(struct squashfs_inode_info),
++ 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
++ init_once);
++ if (squashfs_inode_cachep == NULL)
++ return -ENOMEM;
++ return 0;
++}
++
++
++static void destroy_inodecache(void)
++{
++ kmem_cache_destroy(squashfs_inode_cachep);
++}
++
++
++module_init(init_squashfs_fs);
++module_exit(exit_squashfs_fs);
++MODULE_DESCRIPTION("squashfs 3.2-r2, a compressed read-only filesystem");
++MODULE_AUTHOR("Phillip Lougher <phillip@lougher.org.uk>");
++MODULE_LICENSE("GPL");
+Index: linux-2.6.22/fs/squashfs/Makefile
+===================================================================
+--- /dev/null
++++ linux-2.6.22/fs/squashfs/Makefile
+@@ -0,0 +1,7 @@
++#
++# Makefile for the linux squashfs routines.
++#
++
++obj-$(CONFIG_SQUASHFS) += squashfs.o
++squashfs-y += inode.o
++squashfs-y += squashfs2_0.o
+Index: linux-2.6.22/fs/squashfs/squashfs2_0.c
+===================================================================
+--- /dev/null
++++ linux-2.6.22/fs/squashfs/squashfs2_0.c
+@@ -0,0 +1,742 @@
++/*
++ * Squashfs - a compressed read only filesystem for Linux
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * squashfs2_0.c
++ */
++
++#include <linux/squashfs_fs.h>
++#include <linux/module.h>
++#include <linux/zlib.h>
++#include <linux/fs.h>
++#include <linux/squashfs_fs_sb.h>
++#include <linux/squashfs_fs_i.h>
++
++#include "squashfs.h"
++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir);
++static struct dentry *squashfs_lookup_2(struct inode *, struct dentry *,
++ struct nameidata *);
++
++static struct file_operations squashfs_dir_ops_2 = {
++ .read = generic_read_dir,
++ .readdir = squashfs_readdir_2
++};
++
++static struct inode_operations squashfs_dir_inode_ops_2 = {
++ .lookup = squashfs_lookup_2
++};
++
++static unsigned char squashfs_filetype_table[] = {
++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
++};
++
++static int read_fragment_index_table_2(struct super_block *s)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ if (!(msblk->fragment_index_2 = kmalloc(SQUASHFS_FRAGMENT_INDEX_BYTES_2
++ (sblk->fragments), GFP_KERNEL))) {
++ ERROR("Failed to allocate uid/gid table\n");
++ return 0;
++ }
++
++ if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) &&
++ !squashfs_read_data(s, (char *)
++ msblk->fragment_index_2,
++ sblk->fragment_table_start,
++ SQUASHFS_FRAGMENT_INDEX_BYTES_2
++ (sblk->fragments) |
++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments))) {
++ ERROR("unable to read fragment index table\n");
++ return 0;
++ }
++
++ if (msblk->swap) {
++ int i;
++ unsigned int fragment;
++
++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES_2(sblk->fragments);
++ i++) {
++ SQUASHFS_SWAP_FRAGMENT_INDEXES_2((&fragment),
++ &msblk->fragment_index_2[i], 1);
++ msblk->fragment_index_2[i] = fragment;
++ }
++ }
++
++ return 1;
++}
++
++
++static int get_fragment_location_2(struct super_block *s, unsigned int fragment,
++ long long *fragment_start_block,
++ unsigned int *fragment_size)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ long long start_block =
++ msblk->fragment_index_2[SQUASHFS_FRAGMENT_INDEX_2(fragment)];
++ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET_2(fragment);
++ struct squashfs_fragment_entry_2 fragment_entry;
++
++ if (msblk->swap) {
++ struct squashfs_fragment_entry_2 sfragment_entry;
++
++ if (!squashfs_get_cached_block(s, (char *) &sfragment_entry,
++ start_block, offset,
++ sizeof(sfragment_entry), &start_block,
++ &offset))
++ goto out;
++ SQUASHFS_SWAP_FRAGMENT_ENTRY_2(&fragment_entry, &sfragment_entry);
++ } else
++ if (!squashfs_get_cached_block(s, (char *) &fragment_entry,
++ start_block, offset,
++ sizeof(fragment_entry), &start_block,
++ &offset))
++ goto out;
++
++ *fragment_start_block = fragment_entry.start_block;
++ *fragment_size = fragment_entry.size;
++
++ return 1;
++
++out:
++ return 0;
++}
++
++
++static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i,
++ struct squashfs_base_inode_header_2 *inodeb, unsigned int ino)
++{
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ i->i_ino = ino;
++ i->i_mtime.tv_sec = sblk->mkfs_time;
++ i->i_atime.tv_sec = sblk->mkfs_time;
++ i->i_ctime.tv_sec = sblk->mkfs_time;
++ i->i_uid = msblk->uid[inodeb->uid];
++ i->i_mode = inodeb->mode;
++ i->i_nlink = 1;
++ i->i_size = 0;
++ if (inodeb->guid == SQUASHFS_GUIDS)
++ i->i_gid = i->i_uid;
++ else
++ i->i_gid = msblk->guid[inodeb->guid];
++}
++
++
++static int squashfs_read_inode_2(struct inode *i, squashfs_inode_t inode)
++{
++ struct super_block *s = i->i_sb;
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ unsigned int block = SQUASHFS_INODE_BLK(inode) +
++ sblk->inode_table_start;
++ unsigned int offset = SQUASHFS_INODE_OFFSET(inode);
++ unsigned int ino = i->i_ino;
++ long long next_block;
++ unsigned int next_offset;
++ union squashfs_inode_header_2 id, sid;
++ struct squashfs_base_inode_header_2 *inodeb = &id.base,
++ *sinodeb = &sid.base;
++
++ TRACE("Entered squashfs_iget\n");
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *) sinodeb, block,
++ offset, sizeof(*sinodeb), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(inodeb, sinodeb,
++ sizeof(*sinodeb));
++ } else
++ if (!squashfs_get_cached_block(s, (char *) inodeb, block,
++ offset, sizeof(*inodeb), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ squashfs_new_inode(msblk, i, inodeb, ino);
++
++ switch(inodeb->inode_type) {
++ case SQUASHFS_FILE_TYPE: {
++ struct squashfs_reg_inode_header_2 *inodep = &id.reg;
++ struct squashfs_reg_inode_header_2 *sinodep = &sid.reg;
++ long long frag_blk;
++ unsigned int frag_size = 0;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_REG_INODE_HEADER_2(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ frag_blk = SQUASHFS_INVALID_BLK;
++ if (inodep->fragment != SQUASHFS_INVALID_FRAG &&
++ !get_fragment_location_2(s,
++ inodep->fragment, &frag_blk, &frag_size))
++ goto failed_read;
++
++ i->i_size = inodep->file_size;
++ i->i_fop = &generic_ro_fops;
++ i->i_mode |= S_IFREG;
++ i->i_mtime.tv_sec = inodep->mtime;
++ i->i_atime.tv_sec = inodep->mtime;
++ i->i_ctime.tv_sec = inodep->mtime;
++ i->i_blocks = ((i->i_size - 1) >> 9) + 1;
++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->u.s1.block_list_start = next_block;
++ SQUASHFS_I(i)->offset = next_offset;
++ if (sblk->block_size > 4096)
++ i->i_data.a_ops = &squashfs_aops;
++ else
++ i->i_data.a_ops = &squashfs_aops_4K;
++
++ TRACE("File inode %x:%x, start_block %x, "
++ "block_list_start %llx, offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->start_block, next_block,
++ next_offset);
++ break;
++ }
++ case SQUASHFS_DIR_TYPE: {
++ struct squashfs_dir_inode_header_2 *inodep = &id.dir;
++ struct squashfs_dir_inode_header_2 *sinodep = &sid.dir;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_DIR_INODE_HEADER_2(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_size = inodep->file_size;
++ i->i_op = &squashfs_dir_inode_ops_2;
++ i->i_fop = &squashfs_dir_ops_2;
++ i->i_mode |= S_IFDIR;
++ i->i_mtime.tv_sec = inodep->mtime;
++ i->i_atime.tv_sec = inodep->mtime;
++ i->i_ctime.tv_sec = inodep->mtime;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->offset = inodep->offset;
++ SQUASHFS_I(i)->u.s2.directory_index_count = 0;
++ SQUASHFS_I(i)->u.s2.parent_inode = 0;
++
++ TRACE("Directory inode %x:%x, start_block %x, offset "
++ "%x\n", SQUASHFS_INODE_BLK(inode),
++ offset, inodep->start_block,
++ inodep->offset);
++ break;
++ }
++ case SQUASHFS_LDIR_TYPE: {
++ struct squashfs_ldir_inode_header_2 *inodep = &id.ldir;
++ struct squashfs_ldir_inode_header_2 *sinodep = &sid.ldir;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_LDIR_INODE_HEADER_2(inodep,
++ sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_size = inodep->file_size;
++ i->i_op = &squashfs_dir_inode_ops_2;
++ i->i_fop = &squashfs_dir_ops_2;
++ i->i_mode |= S_IFDIR;
++ i->i_mtime.tv_sec = inodep->mtime;
++ i->i_atime.tv_sec = inodep->mtime;
++ i->i_ctime.tv_sec = inodep->mtime;
++ SQUASHFS_I(i)->start_block = inodep->start_block;
++ SQUASHFS_I(i)->offset = inodep->offset;
++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block;
++ SQUASHFS_I(i)->u.s2.directory_index_offset =
++ next_offset;
++ SQUASHFS_I(i)->u.s2.directory_index_count =
++ inodep->i_count;
++ SQUASHFS_I(i)->u.s2.parent_inode = 0;
++
++ TRACE("Long directory inode %x:%x, start_block %x, "
++ "offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->start_block, inodep->offset);
++ break;
++ }
++ case SQUASHFS_SYMLINK_TYPE: {
++ struct squashfs_symlink_inode_header_2 *inodep =
++ &id.symlink;
++ struct squashfs_symlink_inode_header_2 *sinodep =
++ &sid.symlink;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(inodep,
++ sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_size = inodep->symlink_size;
++ i->i_op = &page_symlink_inode_operations;
++ i->i_data.a_ops = &squashfs_symlink_aops;
++ i->i_mode |= S_IFLNK;
++ SQUASHFS_I(i)->start_block = next_block;
++ SQUASHFS_I(i)->offset = next_offset;
++
++ TRACE("Symbolic link inode %x:%x, start_block %llx, "
++ "offset %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ next_block, next_offset);
++ break;
++ }
++ case SQUASHFS_BLKDEV_TYPE:
++ case SQUASHFS_CHRDEV_TYPE: {
++ struct squashfs_dev_inode_header_2 *inodep = &id.dev;
++ struct squashfs_dev_inode_header_2 *sinodep = &sid.dev;
++
++ if (msblk->swap) {
++ if (!squashfs_get_cached_block(s, (char *)
++ sinodep, block, offset,
++ sizeof(*sinodep), &next_block,
++ &next_offset))
++ goto failed_read;
++ SQUASHFS_SWAP_DEV_INODE_HEADER_2(inodep, sinodep);
++ } else
++ if (!squashfs_get_cached_block(s, (char *)
++ inodep, block, offset,
++ sizeof(*inodep), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ i->i_mode |= (inodeb->inode_type ==
++ SQUASHFS_CHRDEV_TYPE) ? S_IFCHR :
++ S_IFBLK;
++ init_special_inode(i, i->i_mode,
++ old_decode_dev(inodep->rdev));
++
++ TRACE("Device inode %x:%x, rdev %x\n",
++ SQUASHFS_INODE_BLK(inode), offset,
++ inodep->rdev);
++ break;
++ }
++ case SQUASHFS_FIFO_TYPE:
++ case SQUASHFS_SOCKET_TYPE: {
++
++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE)
++ ? S_IFIFO : S_IFSOCK;
++ init_special_inode(i, i->i_mode, 0);
++ break;
++ }
++ default:
++ ERROR("Unknown inode type %d in squashfs_iget!\n",
++ inodeb->inode_type);
++ goto failed_read1;
++ }
++
++ return 1;
++
++failed_read:
++ ERROR("Unable to read inode [%x:%x]\n", block, offset);
++
++failed_read1:
++ return 0;
++}
++
++
++static int get_dir_index_using_offset(struct super_block *s, long long
++ *next_block, unsigned int *next_offset,
++ long long index_start,
++ unsigned int index_offset, int i_count,
++ long long f_pos)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ int i, length = 0;
++ struct squashfs_dir_index_2 index;
++
++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n",
++ i_count, (unsigned int) f_pos);
++
++ if (f_pos == 0)
++ goto finish;
++
++ for (i = 0; i < i_count; i++) {
++ if (msblk->swap) {
++ struct squashfs_dir_index_2 sindex;
++ squashfs_get_cached_block(s, (char *) &sindex,
++ index_start, index_offset,
++ sizeof(sindex), &index_start,
++ &index_offset);
++ SQUASHFS_SWAP_DIR_INDEX_2(&index, &sindex);
++ } else
++ squashfs_get_cached_block(s, (char *) &index,
++ index_start, index_offset,
++ sizeof(index), &index_start,
++ &index_offset);
++
++ if (index.index > f_pos)
++ break;
++
++ squashfs_get_cached_block(s, NULL, index_start, index_offset,
++ index.size + 1, &index_start,
++ &index_offset);
++
++ length = index.index;
++ *next_block = index.start_block + sblk->directory_table_start;
++ }
++
++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
++
++finish:
++ return length;
++}
++
++
++static int get_dir_index_using_name(struct super_block *s, long long
++ *next_block, unsigned int *next_offset,
++ long long index_start,
++ unsigned int index_offset, int i_count,
++ const char *name, int size)
++{
++ struct squashfs_sb_info *msblk = s->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ int i, length = 0;
++ struct squashfs_dir_index_2 *index;
++ char *str;
++
++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count);
++
++ if (!(str = kmalloc(sizeof(struct squashfs_dir_index) +
++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_index\n");
++ goto failure;
++ }
++
++ index = (struct squashfs_dir_index_2 *) (str + SQUASHFS_NAME_LEN + 1);
++ strncpy(str, name, size);
++ str[size] = '\0';
++
++ for (i = 0; i < i_count; i++) {
++ if (msblk->swap) {
++ struct squashfs_dir_index_2 sindex;
++ squashfs_get_cached_block(s, (char *) &sindex,
++ index_start, index_offset,
++ sizeof(sindex), &index_start,
++ &index_offset);
++ SQUASHFS_SWAP_DIR_INDEX_2(index, &sindex);
++ } else
++ squashfs_get_cached_block(s, (char *) index,
++ index_start, index_offset,
++ sizeof(struct squashfs_dir_index_2),
++ &index_start, &index_offset);
++
++ squashfs_get_cached_block(s, index->name, index_start,
++ index_offset, index->size + 1,
++ &index_start, &index_offset);
++
++ index->name[index->size + 1] = '\0';
++
++ if (strcmp(index->name, str) > 0)
++ break;
++
++ length = index->index;
++ *next_block = index->start_block + sblk->directory_table_start;
++ }
++
++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;
++ kfree(str);
++failure:
++ return length;
++}
++
++
++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir)
++{
++ struct inode *i = file->f_dentry->d_inode;
++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ long long next_block = SQUASHFS_I(i)->start_block +
++ sblk->directory_table_start;
++ int next_offset = SQUASHFS_I(i)->offset, length = 0,
++ dir_count;
++ struct squashfs_dir_header_2 dirh;
++ struct squashfs_dir_entry_2 *dire;
++
++ TRACE("Entered squashfs_readdir_2 [%llx:%x]\n", next_block, next_offset);
++
++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) +
++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_entry\n");
++ goto finish;
++ }
++
++ length = get_dir_index_using_offset(i->i_sb, &next_block, &next_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_start,
++ SQUASHFS_I(i)->u.s2.directory_index_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_count,
++ file->f_pos);
++
++ while (length < i_size_read(i)) {
++ /* read directory header */
++ if (msblk->swap) {
++ struct squashfs_dir_header_2 sdirh;
++
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
++ next_block, next_offset, sizeof(sdirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdirh);
++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh,
++ next_block, next_offset, sizeof(dirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(dirh);
++ }
++
++ dir_count = dirh.count + 1;
++ while (dir_count--) {
++ if (msblk->swap) {
++ struct squashfs_dir_entry_2 sdire;
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ &sdire, next_block, next_offset,
++ sizeof(sdire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdire);
++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ dire, next_block, next_offset,
++ sizeof(*dire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(*dire);
++ }
++
++ if (!squashfs_get_cached_block(i->i_sb, dire->name,
++ next_block, next_offset,
++ dire->size + 1, &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += dire->size + 1;
++
++ if (file->f_pos >= length)
++ continue;
++
++ dire->name[dire->size + 1] = '\0';
++
++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d)\n",
++ (unsigned int) dirent, dire->name,
++ dire->size + 1, (int) file->f_pos,
++ dirh.start_block, dire->offset,
++ squashfs_filetype_table[dire->type]);
++
++ if (filldir(dirent, dire->name, dire->size + 1,
++ file->f_pos, SQUASHFS_MK_VFS_INODE(
++ dirh.start_block, dire->offset),
++ squashfs_filetype_table[dire->type])
++ < 0) {
++ TRACE("Filldir returned less than 0\n");
++ goto finish;
++ }
++ file->f_pos = length;
++ }
++ }
++
++finish:
++ kfree(dire);
++ return 0;
++
++failed_read:
++ ERROR("Unable to read directory block [%llx:%x]\n", next_block,
++ next_offset);
++ kfree(dire);
++ return 0;
++}
++
++
++static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry,
++ struct nameidata *nd)
++{
++ const unsigned char *name = dentry->d_name.name;
++ int len = dentry->d_name.len;
++ struct inode *inode = NULL;
++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info;
++ struct squashfs_super_block *sblk = &msblk->sblk;
++ long long next_block = SQUASHFS_I(i)->start_block +
++ sblk->directory_table_start;
++ int next_offset = SQUASHFS_I(i)->offset, length = 0,
++ dir_count;
++ struct squashfs_dir_header_2 dirh;
++ struct squashfs_dir_entry_2 *dire;
++ int sorted = sblk->s_major == 2 && sblk->s_minor >= 1;
++
++ TRACE("Entered squashfs_lookup_2 [%llx:%x]\n", next_block, next_offset);
++
++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) +
++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) {
++ ERROR("Failed to allocate squashfs_dir_entry\n");
++ goto exit_loop;
++ }
++
++ if (len > SQUASHFS_NAME_LEN)
++ goto exit_loop;
++
++ length = get_dir_index_using_name(i->i_sb, &next_block, &next_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_start,
++ SQUASHFS_I(i)->u.s2.directory_index_offset,
++ SQUASHFS_I(i)->u.s2.directory_index_count, name,
++ len);
++
++ while (length < i_size_read(i)) {
++ /* read directory header */
++ if (msblk->swap) {
++ struct squashfs_dir_header_2 sdirh;
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh,
++ next_block, next_offset, sizeof(sdirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdirh);
++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh,
++ next_block, next_offset, sizeof(dirh),
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += sizeof(dirh);
++ }
++
++ dir_count = dirh.count + 1;
++ while (dir_count--) {
++ if (msblk->swap) {
++ struct squashfs_dir_entry_2 sdire;
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ &sdire, next_block,next_offset,
++ sizeof(sdire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(sdire);
++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire);
++ } else {
++ if (!squashfs_get_cached_block(i->i_sb, (char *)
++ dire, next_block,next_offset,
++ sizeof(*dire), &next_block,
++ &next_offset))
++ goto failed_read;
++
++ length += sizeof(*dire);
++ }
++
++ if (!squashfs_get_cached_block(i->i_sb, dire->name,
++ next_block, next_offset, dire->size + 1,
++ &next_block, &next_offset))
++ goto failed_read;
++
++ length += dire->size + 1;
++
++ if (sorted && name[0] < dire->name[0])
++ goto exit_loop;
++
++ if ((len == dire->size + 1) && !strncmp(name,
++ dire->name, len)) {
++ squashfs_inode_t ino =
++ SQUASHFS_MKINODE(dirh.start_block,
++ dire->offset);
++ unsigned int inode_number = SQUASHFS_MK_VFS_INODE(dirh.start_block,
++ dire->offset);
++
++ TRACE("calling squashfs_iget for directory "
++ "entry %s, inode %x:%x, %lld\n", name,
++ dirh.start_block, dire->offset, ino);
++
++ inode = squashfs_iget(i->i_sb, ino, inode_number);
++
++ goto exit_loop;
++ }
++ }
++ }
++
++exit_loop:
++ kfree(dire);
++ d_add(dentry, inode);
++ return ERR_PTR(0);
++
++failed_read:
++ ERROR("Unable to read directory block [%llx:%x]\n", next_block,
++ next_offset);
++ goto exit_loop;
++}
++
++
++int squashfs_2_0_supported(struct squashfs_sb_info *msblk)
++{
++ struct squashfs_super_block *sblk = &msblk->sblk;
++
++ msblk->read_inode = squashfs_read_inode_2;
++ msblk->read_fragment_index_table = read_fragment_index_table_2;
++
++ sblk->bytes_used = sblk->bytes_used_2;
++ sblk->uid_start = sblk->uid_start_2;
++ sblk->guid_start = sblk->guid_start_2;
++ sblk->inode_table_start = sblk->inode_table_start_2;
++ sblk->directory_table_start = sblk->directory_table_start_2;
++ sblk->fragment_table_start = sblk->fragment_table_start_2;
++
++ return 1;
++}
+Index: linux-2.6.22/fs/squashfs/squashfs.h
+===================================================================
+--- /dev/null
++++ linux-2.6.22/fs/squashfs/squashfs.h
+@@ -0,0 +1,87 @@
++/*
++ * Squashfs - a compressed read only filesystem for Linux
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * squashfs.h
++ */
++
++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
++#undef CONFIG_SQUASHFS_1_0_COMPATIBILITY
++#endif
++
++#ifdef SQUASHFS_TRACE
++#define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args)
++#else
++#define TRACE(s, args...) {}
++#endif
++
++#define ERROR(s, args...) printk(KERN_ERR "SQUASHFS error: "s, ## args)
++
++#define SERROR(s, args...) do { \
++ if (!silent) \
++ printk(KERN_ERR "SQUASHFS error: "s, ## args);\
++ } while(0)
++
++#define WARNING(s, args...) printk(KERN_WARNING "SQUASHFS: "s, ## args)
++
++static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode)
++{
++ return list_entry(inode, struct squashfs_inode_info, vfs_inode);
++}
++
++#if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY)
++#define SQSH_EXTERN
++extern unsigned int squashfs_read_data(struct super_block *s, char *buffer,
++ long long index, unsigned int length,
++ long long *next_index, int srclength);
++extern int squashfs_get_cached_block(struct super_block *s, char *buffer,
++ long long block, unsigned int offset,
++ int length, long long *next_block,
++ unsigned int *next_offset);
++extern void release_cached_fragment(struct squashfs_sb_info *msblk, struct
++ squashfs_fragment_cache *fragment);
++extern struct squashfs_fragment_cache *get_cached_fragment(struct super_block
++ *s, long long start_block,
++ int length);
++extern struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number);
++extern const struct address_space_operations squashfs_symlink_aops;
++extern const struct address_space_operations squashfs_aops;
++extern const struct address_space_operations squashfs_aops_4K;
++extern struct inode_operations squashfs_dir_inode_ops;
++#else
++#define SQSH_EXTERN static
++#endif
++
++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
++extern int squashfs_1_0_supported(struct squashfs_sb_info *msblk);
++#else
++static inline int squashfs_1_0_supported(struct squashfs_sb_info *msblk)
++{
++ return 0;
++}
++#endif
++
++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
++extern int squashfs_2_0_supported(struct squashfs_sb_info *msblk);
++#else
++static inline int squashfs_2_0_supported(struct squashfs_sb_info *msblk)
++{
++ return 0;
++}
++#endif
+Index: linux-2.6.22/include/linux/squashfs_fs.h
+===================================================================
+--- /dev/null
++++ linux-2.6.22/include/linux/squashfs_fs.h
+@@ -0,0 +1,934 @@
++#ifndef SQUASHFS_FS
++#define SQUASHFS_FS
++
++/*
++ * Squashfs
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * squashfs_fs.h
++ */
++
++#ifndef CONFIG_SQUASHFS_2_0_COMPATIBILITY
++#define CONFIG_SQUASHFS_2_0_COMPATIBILITY
++#endif
++
++#ifdef CONFIG_SQUASHFS_VMALLOC
++#define SQUASHFS_ALLOC(a) vmalloc(a)
++#define SQUASHFS_FREE(a) vfree(a)
++#else
++#define SQUASHFS_ALLOC(a) kmalloc(a, GFP_KERNEL)
++#define SQUASHFS_FREE(a) kfree(a)
++#endif
++#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
++#define SQUASHFS_MAJOR 3
++#define SQUASHFS_MINOR 0
++#define SQUASHFS_MAGIC 0x73717368
++#define SQUASHFS_MAGIC_SWAP 0x68737173
++#define SQUASHFS_START 0
++
++/* size of metadata (inode and directory) blocks */
++#define SQUASHFS_METADATA_SIZE 8192
++#define SQUASHFS_METADATA_LOG 13
++
++/* default size of data blocks */
++#define SQUASHFS_FILE_SIZE 65536
++#define SQUASHFS_FILE_LOG 16
++
++#define SQUASHFS_FILE_MAX_SIZE 65536
++
++/* Max number of uids and gids */
++#define SQUASHFS_UIDS 256
++#define SQUASHFS_GUIDS 255
++
++/* Max length of filename (not 255) */
++#define SQUASHFS_NAME_LEN 256
++
++#define SQUASHFS_INVALID ((long long) 0xffffffffffff)
++#define SQUASHFS_INVALID_FRAG ((unsigned int) 0xffffffff)
++#define SQUASHFS_INVALID_BLK ((long long) -1)
++#define SQUASHFS_USED_BLK ((long long) -2)
++
++/* Filesystem flags */
++#define SQUASHFS_NOI 0
++#define SQUASHFS_NOD 1
++#define SQUASHFS_CHECK 2
++#define SQUASHFS_NOF 3
++#define SQUASHFS_NO_FRAG 4
++#define SQUASHFS_ALWAYS_FRAG 5
++#define SQUASHFS_DUPLICATE 6
++#define SQUASHFS_EXPORT 7
++
++#define SQUASHFS_BIT(flag, bit) ((flag >> bit) & 1)
++
++#define SQUASHFS_UNCOMPRESSED_INODES(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_NOI)
++
++#define SQUASHFS_UNCOMPRESSED_DATA(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_NOD)
++
++#define SQUASHFS_UNCOMPRESSED_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_NOF)
++
++#define SQUASHFS_NO_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_NO_FRAG)
++
++#define SQUASHFS_ALWAYS_FRAGMENTS(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_ALWAYS_FRAG)
++
++#define SQUASHFS_DUPLICATES(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_DUPLICATE)
++
++#define SQUASHFS_EXPORTABLE(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_EXPORT)
++
++#define SQUASHFS_CHECK_DATA(flags) SQUASHFS_BIT(flags, \
++ SQUASHFS_CHECK)
++
++#define SQUASHFS_MKFLAGS(noi, nod, check_data, nof, no_frag, always_frag, \
++ duplicate_checking, exortable) (noi | (nod << 1) | (check_data << 2) \
++ | (nof << 3) | (no_frag << 4) | (always_frag << 5) | \
++ (duplicate_checking << 6) | (exportable << 7))
++
++/* Max number of types and file types */
++#define SQUASHFS_DIR_TYPE 1
++#define SQUASHFS_FILE_TYPE 2
++#define SQUASHFS_SYMLINK_TYPE 3
++#define SQUASHFS_BLKDEV_TYPE 4
++#define SQUASHFS_CHRDEV_TYPE 5
++#define SQUASHFS_FIFO_TYPE 6
++#define SQUASHFS_SOCKET_TYPE 7
++#define SQUASHFS_LDIR_TYPE 8
++#define SQUASHFS_LREG_TYPE 9
++
++/* 1.0 filesystem type definitions */
++#define SQUASHFS_TYPES 5
++#define SQUASHFS_IPC_TYPE 0
++
++/* Flag whether block is compressed or uncompressed, bit is set if block is
++ * uncompressed */
++#define SQUASHFS_COMPRESSED_BIT (1 << 15)
++
++#define SQUASHFS_COMPRESSED_SIZE(B) (((B) & ~SQUASHFS_COMPRESSED_BIT) ? \
++ (B) & ~SQUASHFS_COMPRESSED_BIT : SQUASHFS_COMPRESSED_BIT)
++
++#define SQUASHFS_COMPRESSED(B) (!((B) & SQUASHFS_COMPRESSED_BIT))
++
++#define SQUASHFS_COMPRESSED_BIT_BLOCK (1 << 24)
++
++#define SQUASHFS_COMPRESSED_SIZE_BLOCK(B) (((B) & \
++ ~SQUASHFS_COMPRESSED_BIT_BLOCK) ? (B) & \
++ ~SQUASHFS_COMPRESSED_BIT_BLOCK : SQUASHFS_COMPRESSED_BIT_BLOCK)
++
++#define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK))
++
++/*
++ * Inode number ops. Inodes consist of a compressed block number, and an
++ * uncompressed offset within that block
++ */
++#define SQUASHFS_INODE_BLK(a) ((unsigned int) ((a) >> 16))
++
++#define SQUASHFS_INODE_OFFSET(a) ((unsigned int) ((a) & 0xffff))
++
++#define SQUASHFS_MKINODE(A, B) ((squashfs_inode_t)(((squashfs_inode_t) (A)\
++ << 16) + (B)))
++
++/* Compute 32 bit VFS inode number from squashfs inode number */
++#define SQUASHFS_MK_VFS_INODE(a, b) ((unsigned int) (((a) << 8) + \
++ ((b) >> 2) + 1))
++/* XXX */
++
++/* Translate between VFS mode and squashfs mode */
++#define SQUASHFS_MODE(a) ((a) & 0xfff)
++
++/* fragment and fragment table defines */
++#define SQUASHFS_FRAGMENT_BYTES(A) ((A) * sizeof(struct squashfs_fragment_entry))
++
++#define SQUASHFS_FRAGMENT_INDEX(A) (SQUASHFS_FRAGMENT_BYTES(A) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEX_OFFSET(A) (SQUASHFS_FRAGMENT_BYTES(A) % \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEXES(A) ((SQUASHFS_FRAGMENT_BYTES(A) + \
++ SQUASHFS_METADATA_SIZE - 1) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEX_BYTES(A) (SQUASHFS_FRAGMENT_INDEXES(A) *\
++ sizeof(long long))
++
++/* inode lookup table defines */
++#define SQUASHFS_LOOKUP_BYTES(A) ((A) * sizeof(squashfs_inode_t))
++
++#define SQUASHFS_LOOKUP_BLOCK(A) (SQUASHFS_LOOKUP_BYTES(A) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_LOOKUP_BLOCK_OFFSET(A) (SQUASHFS_LOOKUP_BYTES(A) % \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_LOOKUP_BLOCKS(A) ((SQUASHFS_LOOKUP_BYTES(A) + \
++ SQUASHFS_METADATA_SIZE - 1) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_LOOKUP_BLOCK_BYTES(A) (SQUASHFS_LOOKUP_BLOCKS(A) *\
++ sizeof(long long))
++
++/* cached data constants for filesystem */
++#define SQUASHFS_CACHED_BLKS 8
++
++#define SQUASHFS_MAX_FILE_SIZE_LOG 64
++
++#define SQUASHFS_MAX_FILE_SIZE ((long long) 1 << \
++ (SQUASHFS_MAX_FILE_SIZE_LOG - 2))
++
++#define SQUASHFS_MARKER_BYTE 0xff
++
++/* meta index cache */
++#define SQUASHFS_META_INDEXES (SQUASHFS_METADATA_SIZE / sizeof(unsigned int))
++#define SQUASHFS_META_ENTRIES 31
++#define SQUASHFS_META_NUMBER 8
++#define SQUASHFS_SLOTS 4
++
++struct meta_entry {
++ long long data_block;
++ unsigned int index_block;
++ unsigned short offset;
++ unsigned short pad;
++};
++
++struct meta_index {
++ unsigned int inode_number;
++ unsigned int offset;
++ unsigned short entries;
++ unsigned short skip;
++ unsigned short locked;
++ unsigned short pad;
++ struct meta_entry meta_entry[SQUASHFS_META_ENTRIES];
++};
++
++
++/*
++ * definitions for structures on disk
++ */
++
++typedef long long squashfs_block_t;
++typedef long long squashfs_inode_t;
++
++struct squashfs_super_block {
++ unsigned int s_magic;
++ unsigned int inodes;
++ unsigned int bytes_used_2;
++ unsigned int uid_start_2;
++ unsigned int guid_start_2;
++ unsigned int inode_table_start_2;
++ unsigned int directory_table_start_2;
++ unsigned int s_major:16;
++ unsigned int s_minor:16;
++ unsigned int block_size_1:16;
++ unsigned int block_log:16;
++ unsigned int flags:8;
++ unsigned int no_uids:8;
++ unsigned int no_guids:8;
++ unsigned int mkfs_time /* time of filesystem creation */;
++ squashfs_inode_t root_inode;
++ unsigned int block_size;
++ unsigned int fragments;
++ unsigned int fragment_table_start_2;
++ long long bytes_used;
++ long long uid_start;
++ long long guid_start;
++ long long inode_table_start;
++ long long directory_table_start;
++ long long fragment_table_start;
++ long long lookup_table_start;
++} __attribute__ ((packed));
++
++struct squashfs_dir_index {
++ unsigned int index;
++ unsigned int start_block;
++ unsigned char size;
++ unsigned char name[0];
++} __attribute__ ((packed));
++
++#define SQUASHFS_BASE_INODE_HEADER \
++ unsigned int inode_type:4; \
++ unsigned int mode:12; \
++ unsigned int uid:8; \
++ unsigned int guid:8; \
++ unsigned int mtime; \
++ unsigned int inode_number;
++
++struct squashfs_base_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++} __attribute__ ((packed));
++
++struct squashfs_ipc_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++} __attribute__ ((packed));
++
++struct squashfs_dev_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++ unsigned short rdev;
++} __attribute__ ((packed));
++
++struct squashfs_symlink_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++ unsigned short symlink_size;
++ char symlink[0];
++} __attribute__ ((packed));
++
++struct squashfs_reg_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ squashfs_block_t start_block;
++ unsigned int fragment;
++ unsigned int offset;
++ unsigned int file_size;
++ unsigned short block_list[0];
++} __attribute__ ((packed));
++
++struct squashfs_lreg_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++ squashfs_block_t start_block;
++ unsigned int fragment;
++ unsigned int offset;
++ long long file_size;
++ unsigned short block_list[0];
++} __attribute__ ((packed));
++
++struct squashfs_dir_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++ unsigned int file_size:19;
++ unsigned int offset:13;
++ unsigned int start_block;
++ unsigned int parent_inode;
++} __attribute__ ((packed));
++
++struct squashfs_ldir_inode_header {
++ SQUASHFS_BASE_INODE_HEADER;
++ unsigned int nlink;
++ unsigned int file_size:27;
++ unsigned int offset:13;
++ unsigned int start_block;
++ unsigned int i_count:16;
++ unsigned int parent_inode;
++ struct squashfs_dir_index index[0];
++} __attribute__ ((packed));
++
++union squashfs_inode_header {
++ struct squashfs_base_inode_header base;
++ struct squashfs_dev_inode_header dev;
++ struct squashfs_symlink_inode_header symlink;
++ struct squashfs_reg_inode_header reg;
++ struct squashfs_lreg_inode_header lreg;
++ struct squashfs_dir_inode_header dir;
++ struct squashfs_ldir_inode_header ldir;
++ struct squashfs_ipc_inode_header ipc;
++};
++
++struct squashfs_dir_entry {
++ unsigned int offset:13;
++ unsigned int type:3;
++ unsigned int size:8;
++ int inode_number:16;
++ char name[0];
++} __attribute__ ((packed));
++
++struct squashfs_dir_header {
++ unsigned int count:8;
++ unsigned int start_block;
++ unsigned int inode_number;
++} __attribute__ ((packed));
++
++struct squashfs_fragment_entry {
++ long long start_block;
++ unsigned int size;
++ unsigned int pending;
++} __attribute__ ((packed));
++
++extern int squashfs_uncompress_block(void *d, int dstlen, void *s, int srclen);
++extern int squashfs_uncompress_init(void);
++extern int squashfs_uncompress_exit(void);
++
++/*
++ * macros to convert each packed bitfield structure from little endian to big
++ * endian and vice versa. These are needed when creating or using a filesystem
++ * on a machine with different byte ordering to the target architecture.
++ *
++ */
++
++#define SQUASHFS_SWAP_START \
++ int bits;\
++ int b_pos;\
++ unsigned long long val;\
++ unsigned char *s;\
++ unsigned char *d;
++
++#define SQUASHFS_SWAP_SUPER_BLOCK(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_super_block));\
++ SQUASHFS_SWAP((s)->s_magic, d, 0, 32);\
++ SQUASHFS_SWAP((s)->inodes, d, 32, 32);\
++ SQUASHFS_SWAP((s)->bytes_used_2, d, 64, 32);\
++ SQUASHFS_SWAP((s)->uid_start_2, d, 96, 32);\
++ SQUASHFS_SWAP((s)->guid_start_2, d, 128, 32);\
++ SQUASHFS_SWAP((s)->inode_table_start_2, d, 160, 32);\
++ SQUASHFS_SWAP((s)->directory_table_start_2, d, 192, 32);\
++ SQUASHFS_SWAP((s)->s_major, d, 224, 16);\
++ SQUASHFS_SWAP((s)->s_minor, d, 240, 16);\
++ SQUASHFS_SWAP((s)->block_size_1, d, 256, 16);\
++ SQUASHFS_SWAP((s)->block_log, d, 272, 16);\
++ SQUASHFS_SWAP((s)->flags, d, 288, 8);\
++ SQUASHFS_SWAP((s)->no_uids, d, 296, 8);\
++ SQUASHFS_SWAP((s)->no_guids, d, 304, 8);\
++ SQUASHFS_SWAP((s)->mkfs_time, d, 312, 32);\
++ SQUASHFS_SWAP((s)->root_inode, d, 344, 64);\
++ SQUASHFS_SWAP((s)->block_size, d, 408, 32);\
++ SQUASHFS_SWAP((s)->fragments, d, 440, 32);\
++ SQUASHFS_SWAP((s)->fragment_table_start_2, d, 472, 32);\
++ SQUASHFS_SWAP((s)->bytes_used, d, 504, 64);\
++ SQUASHFS_SWAP((s)->uid_start, d, 568, 64);\
++ SQUASHFS_SWAP((s)->guid_start, d, 632, 64);\
++ SQUASHFS_SWAP((s)->inode_table_start, d, 696, 64);\
++ SQUASHFS_SWAP((s)->directory_table_start, d, 760, 64);\
++ SQUASHFS_SWAP((s)->fragment_table_start, d, 824, 64);\
++ SQUASHFS_SWAP((s)->lookup_table_start, d, 888, 64);\
++}
++
++#define SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\
++ SQUASHFS_MEMSET(s, d, n);\
++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\
++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\
++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\
++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\
++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\
++ SQUASHFS_SWAP((s)->inode_number, d, 64, 32);
++
++#define SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, n) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\
++}
++
++#define SQUASHFS_SWAP_IPC_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_ipc_inode_header))\
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++}
++
++#define SQUASHFS_SWAP_DEV_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_dev_inode_header)); \
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++ SQUASHFS_SWAP((s)->rdev, d, 128, 16);\
++}
++
++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_symlink_inode_header));\
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++ SQUASHFS_SWAP((s)->symlink_size, d, 128, 16);\
++}
++
++#define SQUASHFS_SWAP_REG_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_reg_inode_header));\
++ SQUASHFS_SWAP((s)->start_block, d, 96, 64);\
++ SQUASHFS_SWAP((s)->fragment, d, 160, 32);\
++ SQUASHFS_SWAP((s)->offset, d, 192, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 224, 32);\
++}
++
++#define SQUASHFS_SWAP_LREG_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_lreg_inode_header));\
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 128, 64);\
++ SQUASHFS_SWAP((s)->fragment, d, 192, 32);\
++ SQUASHFS_SWAP((s)->offset, d, 224, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 256, 64);\
++}
++
++#define SQUASHFS_SWAP_DIR_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_dir_inode_header));\
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 128, 19);\
++ SQUASHFS_SWAP((s)->offset, d, 147, 13);\
++ SQUASHFS_SWAP((s)->start_block, d, 160, 32);\
++ SQUASHFS_SWAP((s)->parent_inode, d, 192, 32);\
++}
++
++#define SQUASHFS_SWAP_LDIR_INODE_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \
++ sizeof(struct squashfs_ldir_inode_header));\
++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 128, 27);\
++ SQUASHFS_SWAP((s)->offset, d, 155, 13);\
++ SQUASHFS_SWAP((s)->start_block, d, 168, 32);\
++ SQUASHFS_SWAP((s)->i_count, d, 200, 16);\
++ SQUASHFS_SWAP((s)->parent_inode, d, 216, 32);\
++}
++
++#define SQUASHFS_SWAP_DIR_INDEX(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index));\
++ SQUASHFS_SWAP((s)->index, d, 0, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 32, 32);\
++ SQUASHFS_SWAP((s)->size, d, 64, 8);\
++}
++
++#define SQUASHFS_SWAP_DIR_HEADER(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header));\
++ SQUASHFS_SWAP((s)->count, d, 0, 8);\
++ SQUASHFS_SWAP((s)->start_block, d, 8, 32);\
++ SQUASHFS_SWAP((s)->inode_number, d, 40, 32);\
++}
++
++#define SQUASHFS_SWAP_DIR_ENTRY(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry));\
++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\
++ SQUASHFS_SWAP((s)->type, d, 13, 3);\
++ SQUASHFS_SWAP((s)->size, d, 16, 8);\
++ SQUASHFS_SWAP((s)->inode_number, d, 24, 16);\
++}
++
++#define SQUASHFS_SWAP_FRAGMENT_ENTRY(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry));\
++ SQUASHFS_SWAP((s)->start_block, d, 0, 64);\
++ SQUASHFS_SWAP((s)->size, d, 64, 32);\
++}
++
++#define SQUASHFS_SWAP_INODE_T(s, d) SQUASHFS_SWAP_LONG_LONGS(s, d, 1)
++
++#define SQUASHFS_SWAP_SHORTS(s, d, n) {\
++ int entry;\
++ int bit_position;\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, n * 2);\
++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \
++ 16)\
++ SQUASHFS_SWAP(s[entry], d, bit_position, 16);\
++}
++
++#define SQUASHFS_SWAP_INTS(s, d, n) {\
++ int entry;\
++ int bit_position;\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, n * 4);\
++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \
++ 32)\
++ SQUASHFS_SWAP(s[entry], d, bit_position, 32);\
++}
++
++#define SQUASHFS_SWAP_LONG_LONGS(s, d, n) {\
++ int entry;\
++ int bit_position;\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, n * 8);\
++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \
++ 64)\
++ SQUASHFS_SWAP(s[entry], d, bit_position, 64);\
++}
++
++#define SQUASHFS_SWAP_DATA(s, d, n, bits) {\
++ int entry;\
++ int bit_position;\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, n * bits / 8);\
++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \
++ bits)\
++ SQUASHFS_SWAP(s[entry], d, bit_position, bits);\
++}
++
++#define SQUASHFS_SWAP_FRAGMENT_INDEXES(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n)
++#define SQUASHFS_SWAP_LOOKUP_BLOCKS(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n)
++
++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY
++
++struct squashfs_base_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++} __attribute__ ((packed));
++
++struct squashfs_ipc_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++ unsigned int type:4;
++ unsigned int offset:4;
++} __attribute__ ((packed));
++
++struct squashfs_dev_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++ unsigned short rdev;
++} __attribute__ ((packed));
++
++struct squashfs_symlink_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++ unsigned short symlink_size;
++ char symlink[0];
++} __attribute__ ((packed));
++
++struct squashfs_reg_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++ unsigned int mtime;
++ unsigned int start_block;
++ unsigned int file_size:32;
++ unsigned short block_list[0];
++} __attribute__ ((packed));
++
++struct squashfs_dir_inode_header_1 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:4; /* index into uid table */
++ unsigned int guid:4; /* index into guid table */
++ unsigned int file_size:19;
++ unsigned int offset:13;
++ unsigned int mtime;
++ unsigned int start_block:24;
++} __attribute__ ((packed));
++
++#define SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n) \
++ SQUASHFS_MEMSET(s, d, n);\
++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\
++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\
++ SQUASHFS_SWAP((s)->uid, d, 16, 4);\
++ SQUASHFS_SWAP((s)->guid, d, 20, 4);
++
++#define SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, n) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n)\
++}
++
++#define SQUASHFS_SWAP_IPC_INODE_HEADER_1(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \
++ sizeof(struct squashfs_ipc_inode_header_1));\
++ SQUASHFS_SWAP((s)->type, d, 24, 4);\
++ SQUASHFS_SWAP((s)->offset, d, 28, 4);\
++}
++
++#define SQUASHFS_SWAP_DEV_INODE_HEADER_1(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \
++ sizeof(struct squashfs_dev_inode_header_1));\
++ SQUASHFS_SWAP((s)->rdev, d, 24, 16);\
++}
++
++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_1(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \
++ sizeof(struct squashfs_symlink_inode_header_1));\
++ SQUASHFS_SWAP((s)->symlink_size, d, 24, 16);\
++}
++
++#define SQUASHFS_SWAP_REG_INODE_HEADER_1(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \
++ sizeof(struct squashfs_reg_inode_header_1));\
++ SQUASHFS_SWAP((s)->mtime, d, 24, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 56, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 88, 32);\
++}
++
++#define SQUASHFS_SWAP_DIR_INODE_HEADER_1(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \
++ sizeof(struct squashfs_dir_inode_header_1));\
++ SQUASHFS_SWAP((s)->file_size, d, 24, 19);\
++ SQUASHFS_SWAP((s)->offset, d, 43, 13);\
++ SQUASHFS_SWAP((s)->mtime, d, 56, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 88, 24);\
++}
++
++#endif
++
++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY
++
++struct squashfs_dir_index_2 {
++ unsigned int index:27;
++ unsigned int start_block:29;
++ unsigned char size;
++ unsigned char name[0];
++} __attribute__ ((packed));
++
++struct squashfs_base_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++} __attribute__ ((packed));
++
++struct squashfs_ipc_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++} __attribute__ ((packed));
++
++struct squashfs_dev_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++ unsigned short rdev;
++} __attribute__ ((packed));
++
++struct squashfs_symlink_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++ unsigned short symlink_size;
++ char symlink[0];
++} __attribute__ ((packed));
++
++struct squashfs_reg_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++ unsigned int mtime;
++ unsigned int start_block;
++ unsigned int fragment;
++ unsigned int offset;
++ unsigned int file_size:32;
++ unsigned short block_list[0];
++} __attribute__ ((packed));
++
++struct squashfs_dir_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++ unsigned int file_size:19;
++ unsigned int offset:13;
++ unsigned int mtime;
++ unsigned int start_block:24;
++} __attribute__ ((packed));
++
++struct squashfs_ldir_inode_header_2 {
++ unsigned int inode_type:4;
++ unsigned int mode:12; /* protection */
++ unsigned int uid:8; /* index into uid table */
++ unsigned int guid:8; /* index into guid table */
++ unsigned int file_size:27;
++ unsigned int offset:13;
++ unsigned int mtime;
++ unsigned int start_block:24;
++ unsigned int i_count:16;
++ struct squashfs_dir_index_2 index[0];
++} __attribute__ ((packed));
++
++union squashfs_inode_header_2 {
++ struct squashfs_base_inode_header_2 base;
++ struct squashfs_dev_inode_header_2 dev;
++ struct squashfs_symlink_inode_header_2 symlink;
++ struct squashfs_reg_inode_header_2 reg;
++ struct squashfs_dir_inode_header_2 dir;
++ struct squashfs_ldir_inode_header_2 ldir;
++ struct squashfs_ipc_inode_header_2 ipc;
++};
++
++struct squashfs_dir_header_2 {
++ unsigned int count:8;
++ unsigned int start_block:24;
++} __attribute__ ((packed));
++
++struct squashfs_dir_entry_2 {
++ unsigned int offset:13;
++ unsigned int type:3;
++ unsigned int size:8;
++ char name[0];
++} __attribute__ ((packed));
++
++struct squashfs_fragment_entry_2 {
++ unsigned int start_block;
++ unsigned int size;
++} __attribute__ ((packed));
++
++#define SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\
++ SQUASHFS_MEMSET(s, d, n);\
++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\
++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\
++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\
++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\
++
++#define SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, n) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\
++}
++
++#define SQUASHFS_SWAP_IPC_INODE_HEADER_2(s, d) \
++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, sizeof(struct squashfs_ipc_inode_header_2))
++
++#define SQUASHFS_SWAP_DEV_INODE_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \
++ sizeof(struct squashfs_dev_inode_header_2)); \
++ SQUASHFS_SWAP((s)->rdev, d, 32, 16);\
++}
++
++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \
++ sizeof(struct squashfs_symlink_inode_header_2));\
++ SQUASHFS_SWAP((s)->symlink_size, d, 32, 16);\
++}
++
++#define SQUASHFS_SWAP_REG_INODE_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \
++ sizeof(struct squashfs_reg_inode_header_2));\
++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 64, 32);\
++ SQUASHFS_SWAP((s)->fragment, d, 96, 32);\
++ SQUASHFS_SWAP((s)->offset, d, 128, 32);\
++ SQUASHFS_SWAP((s)->file_size, d, 160, 32);\
++}
++
++#define SQUASHFS_SWAP_DIR_INODE_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \
++ sizeof(struct squashfs_dir_inode_header_2));\
++ SQUASHFS_SWAP((s)->file_size, d, 32, 19);\
++ SQUASHFS_SWAP((s)->offset, d, 51, 13);\
++ SQUASHFS_SWAP((s)->mtime, d, 64, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 96, 24);\
++}
++
++#define SQUASHFS_SWAP_LDIR_INODE_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \
++ sizeof(struct squashfs_ldir_inode_header_2));\
++ SQUASHFS_SWAP((s)->file_size, d, 32, 27);\
++ SQUASHFS_SWAP((s)->offset, d, 59, 13);\
++ SQUASHFS_SWAP((s)->mtime, d, 72, 32);\
++ SQUASHFS_SWAP((s)->start_block, d, 104, 24);\
++ SQUASHFS_SWAP((s)->i_count, d, 128, 16);\
++}
++
++#define SQUASHFS_SWAP_DIR_INDEX_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index_2));\
++ SQUASHFS_SWAP((s)->index, d, 0, 27);\
++ SQUASHFS_SWAP((s)->start_block, d, 27, 29);\
++ SQUASHFS_SWAP((s)->size, d, 56, 8);\
++}
++#define SQUASHFS_SWAP_DIR_HEADER_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header_2));\
++ SQUASHFS_SWAP((s)->count, d, 0, 8);\
++ SQUASHFS_SWAP((s)->start_block, d, 8, 24);\
++}
++
++#define SQUASHFS_SWAP_DIR_ENTRY_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry_2));\
++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\
++ SQUASHFS_SWAP((s)->type, d, 13, 3);\
++ SQUASHFS_SWAP((s)->size, d, 16, 8);\
++}
++
++#define SQUASHFS_SWAP_FRAGMENT_ENTRY_2(s, d) {\
++ SQUASHFS_SWAP_START\
++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry_2));\
++ SQUASHFS_SWAP((s)->start_block, d, 0, 32);\
++ SQUASHFS_SWAP((s)->size, d, 32, 32);\
++}
++
++#define SQUASHFS_SWAP_FRAGMENT_INDEXES_2(s, d, n) SQUASHFS_SWAP_INTS(s, d, n)
++
++/* fragment and fragment table defines */
++#define SQUASHFS_FRAGMENT_BYTES_2(A) (A * sizeof(struct squashfs_fragment_entry_2))
++
++#define SQUASHFS_FRAGMENT_INDEX_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEX_OFFSET_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) % \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEXES_2(A) ((SQUASHFS_FRAGMENT_BYTES_2(A) + \
++ SQUASHFS_METADATA_SIZE - 1) / \
++ SQUASHFS_METADATA_SIZE)
++
++#define SQUASHFS_FRAGMENT_INDEX_BYTES_2(A) (SQUASHFS_FRAGMENT_INDEXES_2(A) *\
++ sizeof(int))
++
++#endif
++
++#ifdef __KERNEL__
++
++/*
++ * macros used to swap each structure entry, taking into account
++ * bitfields and different bitfield placing conventions on differing
++ * architectures
++ */
++
++#include <asm/byteorder.h>
++
++#ifdef __BIG_ENDIAN
++ /* convert from little endian to big endian */
++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \
++ tbits, b_pos)
++#else
++ /* convert from big endian to little endian */
++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \
++ tbits, 64 - tbits - b_pos)
++#endif
++
++#define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\
++ b_pos = pos % 8;\
++ val = 0;\
++ s = (unsigned char *)p + (pos / 8);\
++ d = ((unsigned char *) &val) + 7;\
++ for(bits = 0; bits < (tbits + b_pos); bits += 8) \
++ *d-- = *s++;\
++ value = (val >> (SHIFT))/* & ((1 << tbits) - 1)*/;\
++}
++
++#define SQUASHFS_MEMSET(s, d, n) memset(s, 0, n);
++
++#endif
++#endif
+Index: linux-2.6.22/include/linux/squashfs_fs_i.h
+===================================================================
+--- /dev/null
++++ linux-2.6.22/include/linux/squashfs_fs_i.h
+@@ -0,0 +1,45 @@
++#ifndef SQUASHFS_FS_I
++#define SQUASHFS_FS_I
++/*
++ * Squashfs
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * squashfs_fs_i.h
++ */
++
++struct squashfs_inode_info {
++ long long start_block;
++ unsigned int offset;
++ union {
++ struct {
++ long long fragment_start_block;
++ unsigned int fragment_size;
++ unsigned int fragment_offset;
++ long long block_list_start;
++ } s1;
++ struct {
++ long long directory_index_start;
++ unsigned int directory_index_offset;
++ unsigned int directory_index_count;
++ unsigned int parent_inode;
++ } s2;
++ } u;
++ struct inode vfs_inode;
++};
++#endif
+Index: linux-2.6.22/include/linux/squashfs_fs_sb.h
+===================================================================
+--- /dev/null
++++ linux-2.6.22/include/linux/squashfs_fs_sb.h
+@@ -0,0 +1,74 @@
++#ifndef SQUASHFS_FS_SB
++#define SQUASHFS_FS_SB
++/*
++ * Squashfs
++ *
++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007
++ * Phillip Lougher <phillip@lougher.org.uk>
++ *
++ * 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,
++ * 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * squashfs_fs_sb.h
++ */
++
++#include <linux/squashfs_fs.h>
++
++struct squashfs_cache {
++ long long block;
++ int length;
++ long long next_index;
++ char *data;
++};
++
++struct squashfs_fragment_cache {
++ long long block;
++ int length;
++ unsigned int locked;
++ char *data;
++};
++
++struct squashfs_sb_info {
++ struct squashfs_super_block sblk;
++ int devblksize;
++ int devblksize_log2;
++ int swap;
++ struct squashfs_cache *block_cache;
++ struct squashfs_fragment_cache *fragment;
++ int next_cache;
++ int next_fragment;
++ int next_meta_index;
++ unsigned int *uid;
++ unsigned int *guid;
++ long long *fragment_index;
++ unsigned int *fragment_index_2;
++ char *read_page;
++ struct mutex read_data_mutex;
++ struct mutex read_page_mutex;
++ struct mutex block_cache_mutex;
++ struct mutex fragment_mutex;
++ struct mutex meta_index_mutex;
++ wait_queue_head_t waitq;
++ wait_queue_head_t fragment_wait_queue;
++ struct meta_index *meta_index;
++ z_stream stream;
++ long long *inode_lookup_table;
++ int (*read_inode)(struct inode *i, squashfs_inode_t \
++ inode);
++ long long (*read_blocklist)(struct inode *inode, int \
++ index, int readahead_blks, char *block_list, \
++ unsigned short **block_p, unsigned int *bsize);
++ int (*read_fragment_index_table)(struct super_block *s);
++};
++#endif
+Index: linux-2.6.22/init/do_mounts_rd.c
+===================================================================
+--- linux-2.6.22.orig/init/do_mounts_rd.c
++++ linux-2.6.22/init/do_mounts_rd.c
+@@ -5,6 +5,7 @@
+ #include <linux/ext2_fs.h>
+ #include <linux/romfs_fs.h>
+ #include <linux/cramfs_fs.h>
++#include <linux/squashfs_fs.h>
+ #include <linux/initrd.h>
+ #include <linux/string.h>
+
+@@ -39,6 +40,7 @@
+ * numbers could not be found.
+ *
+ * We currently check for the following magic numbers:
++ * squashfs
+ * minix
+ * ext2
+ * romfs
+@@ -53,6 +55,7 @@
+ struct ext2_super_block *ext2sb;
+ struct romfs_super_block *romfsb;
+ struct cramfs_super *cramfsb;
++ struct squashfs_super_block *squashfsb;
+ int nblocks = -1;
+ unsigned char *buf;
+
+@@ -64,6 +67,7 @@
+ ext2sb = (struct ext2_super_block *) buf;
+ romfsb = (struct romfs_super_block *) buf;
+ cramfsb = (struct cramfs_super *) buf;
++ squashfsb = (struct squashfs_super_block *) buf;
+ memset(buf, 0xe5, size);
+
+ /*
+@@ -101,6 +105,18 @@
+ goto done;
+ }
+
++ /* squashfs is at block zero too */
++ if (squashfsb->s_magic == SQUASHFS_MAGIC) {
++ printk(KERN_NOTICE
++ "RAMDISK: squashfs filesystem found at block %d\n",
++ start_block);
++ if (squashfsb->s_major < 3)
++ nblocks = (squashfsb->bytes_used_2+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS;
++ else
++ nblocks = (squashfsb->bytes_used+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS;
++ goto done;
++ }
++
+ /*
+ * Read block 1 to test for minix and ext2 superblock
+ */
diff --git a/packages/linux/linux-openmoko-devel_svn.bb b/packages/linux/linux-openmoko-devel_svn+2.6.23-rc9.bb
index 6fae5da9ef..004a3db9c7 100644
--- a/packages/linux/linux-openmoko-devel_svn.bb
+++ b/packages/linux/linux-openmoko-devel_svn+2.6.23-rc9.bb
@@ -1,24 +1,28 @@
+require linux.inc
+
DESCRIPTION = "Linux 2.6.x (development) kernel for FIC SmartPhones shipping w/ OpenMoko"
-VANILLA_VERSION = "2.6.22.5"
-PV = "${VANILLA_VERSION}-moko11+svnr${SRCREV}"
-PR = "r1"
+VANILLA_VERSION = "2.6.22"
+KERNEL_VERSION = "2.6.23-rc9"
+KERNEL_RELEASE = "2.6.23-rc9"
+PV = "${VANILLA_VERSION}+${KERNEL_RELEASE}-moko11+svnr${SRCREV}"
+PR = "r3"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "30008000"
-require linux.inc
-
##############################################################
# source and patches
#
SRCREV_FORMAT = "patches"
+SRCREV = "3101"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${VANILLA_VERSION}.tar.bz2 \
- svn://svn.openmoko.org/trunk/src/target/kernel;module=patches;proto=http;name=patches \
- file://squashfs.patch;patch=1 \
+ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/patch-${KERNEL_VERSION}.bz2 \
+ svn://svn.openmoko.org/branches/src/target/kernel/2.6.23.x;module=patches;proto=http;name=patches \
+ file://squashfs-2.6.23.patch;patch=1 \
file://fix-EVIOCGRAB-semantics-2.6.22.5.patch;patch=1 \
# file://printascii.patch;patch=1 \
- file://defconfig \
+ file://defconfig-2.6.23-rc9 \
file://logo_linux_clut224.ppm"
S = "${WORKDIR}/linux-${VANILLA_VERSION}"
@@ -47,9 +51,11 @@ module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-neo1973-wm8753"
module_autoload_s3cmci = "s3cmci"
do_prepatch() {
+ cd ${S} && patch -p1 < ${WORKDIR}/patch-${KERNEL_VERSION}
mv ${WORKDIR}/patches ${S}/patches && cd ${S} && quilt push -av
mv patches patches.openmoko
mv .pc .pc.old
+ mv ${WORKDIR}/defconfig-${KERNEL_VERSION} ${WORKDIR}/defconfig
}
addtask prepatch after do_unpack before do_patch
diff --git a/packages/linux/linux.inc b/packages/linux/linux.inc
index 41b0c13179..2c267fb7eb 100644
--- a/packages/linux/linux.inc
+++ b/packages/linux/linux.inc
@@ -18,6 +18,8 @@ DEPENDS_append_fic-gta01 = " u-boot-mkimage-openmoko-native "
DEPENDS_append_fic-gta02 = " u-boot-mkimage-openmoko-native "
+RPSRC = "http://www.rpsys.net/openzaurus/patches/archive"
+
# Specify the commandline for your device
#boot from mmc
@@ -108,7 +110,8 @@ do_install_prepend() {
UBOOT_ENTRYPOINT ?= "20008000"
-KERNEL_IMAGE_BASE_NAME = ${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}
+KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-${MACHINE}"
do_deploy() {
install -d ${DEPLOY_DIR_IMAGE}
@@ -128,6 +131,10 @@ do_deploy() {
rm -f linux.bin.gz
fi
fi
+
+ cd ${DEPLOY_DIR_IMAGE}
+ rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin
+ ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin
}
do_deploy[dirs] = "${S}"
diff --git a/packages/linux/linux_2.6.21.bb b/packages/linux/linux_2.6.21.bb
index 2ef35ef4c0..f2ab2116be 100644
--- a/packages/linux/linux_2.6.21.bb
+++ b/packages/linux/linux_2.6.21.bb
@@ -4,10 +4,12 @@ DEFAULT_PREFERENCE_at91sam9263ek = "-1"
DEFAULT_PREFERENCE_gumstix-connex = "1"
DEFAULT_PREFERENCE_gumstix-verdex = "1"
-PR = "r9"
+PR = "r11"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
- file://defconfig \
+ file://tsc2003.c \
+ file://tsc2003-config.diff;patch=1 \
+ file://defconfig \
"
SRC_URI_append_simpad = "\
@@ -70,9 +72,14 @@ GUMSTIX_PATCHES = "\
file://pxa-regs-fixup.patch;patch=1 \
file://gumstix-fb-logo.patch;patch=1 \
file://gumstix-pxa270-mmc.patch;patch=1 \
- file://pxafb-18bpp-mode.patch;patch=1 \
+ ${RPSRC}/pxa27x_overlay-r5.patch;patch=1 \
file://smc911x-fixup.patch;patch=1 \
"
SRC_URI_append_gumstix-verdex = "${GUMSTIX_PATCHES}"
SRC_URI_append_gumstix-connex = "${GUMSTIX_PATCHES}"
+
+
+do_configure_prepend() {
+ cp ${WORKDIR}/tsc2003.c ${S}/drivers/i2c/chips/
+}
diff --git a/packages/linux/linux_2.6.22.bb b/packages/linux/linux_2.6.22.bb
index 64b57d3076..a3694156d6 100644
--- a/packages/linux/linux_2.6.22.bb
+++ b/packages/linux/linux_2.6.22.bb
@@ -2,7 +2,7 @@ require linux.inc
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
-DEFAULT_PREFERENCE_avr32 = "1"
+DEFAULT_PREFERENCE_cm-x270 = "-1"
PR = "r3"
@@ -10,4 +10,53 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2 \
file://defconfig \
"
-SRC_URI_append_avr32 = "http://avr32linux.org/twiki/pub/Main/LinuxPatches/linux-2.6.22.atmel.3.patch.bz2;patch=1"
+SRC_URI_append_cm-x270 = "\
+ file://0001-cm-x270-base2.patch;patch=1 \
+ file://0002-cm-x270-match-type.patch;patch=1 \
+ file://0003-cm-x270-ide.patch;patch=1 \
+ file://0004-cm-x270-it8152.patch;patch=1 \
+ file://0005-cm-x270-pcmcia.patch;patch=1 \
+ file://0006-ramdisk_load.patch;patch=1 \
+ file://0007-mmcsd_large_cards-r0.patch;patch=1 \
+ file://0008-cm-x270-nand-simplify-name.patch;patch=1"
+
+CMDLINE_cm-x270 = "console=${CMX270_CONSOLE_SERIAL_PORT},38400 monitor=8 bpp=16 mem=64M mtdparts=physmap-flash.0:256k(boot)ro,0x180000(kernel),-(root);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd3 rootfstype=jffs2"
+
+FILES_kernel-image_cm-x270 = ""
+
+python do_compulab_image() {
+ import os
+ import os.path
+ import struct
+
+ machine = bb.data.getVar('MACHINE', d, 1)
+ if machine == "cm-x270":
+ deploy_dir = bb.data.getVar('DEPLOY_DIR_IMAGE', d, 1)
+ kernel_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.bin')
+ img_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.cmx270')
+
+ fo = open(img_file, 'wb')
+
+ image_data = open(kernel_file, 'rb').read()
+
+ # first write size into first 4 bytes
+ size_s = struct.pack('i', len(image_data))
+
+ # truncate size if we are running on a 64-bit host
+ size_s = size_s[:4]
+
+ fo.write(size_s)
+ fo.write(image_data)
+ fo.close()
+
+ os.chdir(deploy_dir)
+ link_file = bb.data.expand('${KERNEL_IMAGE_SYMLINK_NAME}', d) + '.cmx270'
+ img_file = bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.cmx270'
+ try:
+ os.unlink(link_file)
+ except:
+ pass
+ os.symlink(img_file, link_file)
+}
+
+addtask compulab_image after do_deploy before do_package
diff --git a/packages/linux/linux_2.6.23.bb b/packages/linux/linux_2.6.23.bb
new file mode 100644
index 0000000000..b73e9a71fa
--- /dev/null
+++ b/packages/linux/linux_2.6.23.bb
@@ -0,0 +1,63 @@
+require linux.inc
+
+# Mark archs/machines that this kernel supports
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_cm-x270 = "1"
+
+PR = "r0"
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
+ file://binutils-buildid-arm.patch;patch=1 \
+ file://defconfig \
+ "
+
+SRC_URI_append_cm-x270 = "\
+ file://0001-cm-x270-base2.patch;patch=1 \
+ file://0002-cm-x270-match-type.patch;patch=1 \
+ file://0003-cm-x270-ide.patch;patch=1 \
+ file://0004-cm-x270-it8152.patch;patch=1 \
+ file://0005-cm-x270-pcmcia.patch;patch=1 \
+ file://0006-ramdisk_load.patch;patch=1 \
+ file://0007-mmcsd_large_cards-r0.patch;patch=1 \
+ file://0008-cm-x270-nand-simplify-name.patch;patch=1"
+
+CMDLINE_cm-x270 = "console=${CMX270_CONSOLE_SERIAL_PORT},38400 monitor=8 bpp=16 mem=64M mtdparts=physmap-flash.0:256k(boot)ro,0x180000(kernel),-(root);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd3 rootfstype=jffs2"
+
+FILES_kernel-image_cm-x270 = ""
+
+python do_compulab_image() {
+ import os
+ import os.path
+ import struct
+
+ machine = bb.data.getVar('MACHINE', d, 1)
+ if machine == "cm-x270":
+ deploy_dir = bb.data.getVar('DEPLOY_DIR_IMAGE', d, 1)
+ kernel_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.bin')
+ img_file = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.cmx270')
+
+ fo = open(img_file, 'wb')
+
+ image_data = open(kernel_file, 'rb').read()
+
+ # first write size into first 4 bytes
+ size_s = struct.pack('i', len(image_data))
+
+ # truncate size if we are running on a 64-bit host
+ size_s = size_s[:4]
+
+ fo.write(size_s)
+ fo.write(image_data)
+ fo.close()
+
+ os.chdir(deploy_dir)
+ link_file = bb.data.expand('${KERNEL_IMAGE_SYMLINK_NAME}', d) + '.cmx270'
+ img_file = bb.data.expand('${KERNEL_IMAGE_BASE_NAME}', d) + '.cmx270'
+ try:
+ os.unlink(link_file)
+ except:
+ pass
+ os.symlink(img_file, link_file)
+}
+
+addtask compulab_image after do_deploy before do_package
diff --git a/packages/llvm/llvm-gcc4-cross_svn.bb b/packages/llvm/llvm-gcc4-cross_svn.bb
index 48302c371d..9b0e07ab94 100644
--- a/packages/llvm/llvm-gcc4-cross_svn.bb
+++ b/packages/llvm/llvm-gcc4-cross_svn.bb
@@ -4,7 +4,7 @@ LICENSE = "various"
DEPENDS = "llvm-native"
-PV = "2.0+svnr${SRCREV}"
+PV = "2.1+svnr${SRCREV}"
inherit autotools cross
diff --git a/packages/llvm/llvm-native_2.0.bb b/packages/llvm/llvm-native_2.1.bb
index 03e344cc11..6366b9bbbe 100644
--- a/packages/llvm/llvm-native_2.0.bb
+++ b/packages/llvm/llvm-native_2.1.bb
@@ -1,6 +1,6 @@
require llvm.inc
-SRC_URI = "http://llvm.org/releases/2.0/llvm-${PV}.tar.gz"
+SRC_URI = "http://llvm.org/releases/2.1/llvm-${PV}.tar.gz"
inherit native
diff --git a/packages/lm_sensors/files/prefix-fix.patch b/packages/lm_sensors/files/prefix-fix.patch
new file mode 100644
index 0000000000..66ec55c150
--- /dev/null
+++ b/packages/lm_sensors/files/prefix-fix.patch
@@ -0,0 +1,14 @@
+Index: lm_sensors-2.10.1/Makefile
+===================================================================
+--- lm_sensors-2.10.1.orig/Makefile 2007-10-07 19:22:51.000000000 +0200
++++ lm_sensors-2.10.1/Makefile 2007-10-07 19:23:13.000000000 +0200
+@@ -74,9 +74,6 @@
+ # everything, set DESTDIR to the extra prefix.
+ DESTDIR :=
+
+-# This is the prefix that will be used for almost all directories below.
+-PREFIX := /usr/local
+-
+ # Your C compiler
+ CC := gcc
+
diff --git a/packages/lm_sensors/lmsensors-apps_2.10.1.bb b/packages/lm_sensors/lmsensors-apps_2.10.1.bb
index 84fe358647..ce188beb64 100644
--- a/packages/lm_sensors/lmsensors-apps_2.10.1.bb
+++ b/packages/lm_sensors/lmsensors-apps_2.10.1.bb
@@ -5,22 +5,26 @@ LICENSE = "GPL"
PR = "r2"
SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.gz \
- file://iconv.patch;patch=1 \
file://prefix-fix.patch;patch=1 \
file://add-sysfs-ldflags.patch;patch=1"
+SRC_URI_append_uclibc = "file://iconv.patch;patch=1"
+
S = "${WORKDIR}/lm_sensors-${PV}"
do_compile() {
- oe_runmake LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" user PROG_EXTRA=sensors PREFIX=${prefix}
+ oe_runmake LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" user PROG_EXTRA=sensors
}
do_install() {
oe_runmake user_install DESTDIR=${D}
- # backward compatibility with older OE packages
- mv ${D}${sbindir}/* ${D}${bindir}
+ install -d ${D}/.usr
+ mv ${D}/* ${D}/.usr
+ mv ${D}/.usr ${D}/usr
+ install -d ${D}${sysconfdir}
+ mv ${D}/usr/etc/sensors.conf ${D}${sysconfdir}
# move manuals into proper place
install -d ${D}${mandir}
rm -rf ${D}${mandir}/*
@@ -28,7 +32,7 @@ do_install() {
# remove perl or bash scripts
rm ${D}${bindir}/*.pl ${D}${bindir}/ddcmon
- rm ${D}${bindir}/fancontrol ${D}${bindir}/pwmconfig ${D}${bindir}/sensors-detect
+ rm ${D}${sbindir}/fancontrol* ${D}${sbindir}/pwmconfig ${D}${sbindir}/sensors-detect
rm ${D}${mandir}/man8/fancontrol.8 ${D}${mandir}/man8/pwmconfig.8 ${D}${mandir}/man8/sensors-detect.8
}
diff --git a/packages/logrotate/logrotate_3.7.1.bb b/packages/logrotate/logrotate_3.7.1.bb
index b903e60201..0a1647e81d 100644
--- a/packages/logrotate/logrotate_3.7.1.bb
+++ b/packages/logrotate/logrotate_3.7.1.bb
@@ -37,4 +37,4 @@ pkg_postrm() {
mv ${sysconfdir}/crontab.no-${PF} ${sysconfdir}/crontab
}
-CONFFILES += "${sysconfdir}/logrotate.conf"
+CONFFILES_${PN} += "${sysconfdir}/logrotate.conf"
diff --git a/packages/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb b/packages/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb
index efdaaaa06a..5b6ea4edfa 100644
--- a/packages/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb
+++ b/packages/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb
@@ -6,13 +6,11 @@ RPROVIDES_${PN} = matchbox-keyboard
#DEFAULT_PREFERENCE = "-1"
SECTION = "x11"
PV = "0.0+svnr${SRCREV}"
-PR = "r6"
+PR = "r7"
SRC_URI = "svn://svn.o-hand.com/repos/matchbox/trunk;module=matchbox-keyboard;proto=http \
file://smallscreen-fontsize.patch;patch=1 \
- file://matchbox-keyboard-applet.patch;patch=1;pnum=0 \
- file://80matchboxkeyboard \
- file://matchbox-keyboard-hide-delay.patch;patch=1"
+ file://80matchboxkeyboard"
SRC_URI_append_fic-gta01 = " file://fic-gta01-font-size.patch;patch=1"
diff --git a/packages/mono/mono_1.2.5.1-files.inc b/packages/mono/mono_1.2.5.1-files.inc
new file mode 100644
index 0000000000..3dc580750f
--- /dev/null
+++ b/packages/mono/mono_1.2.5.1-files.inc
@@ -0,0 +1,1634 @@
+# This is a generated file, please do not edit directly
+# Use collect-files.py instead. -- Henryk <henryk@openmoko.org>
+FILES_mono-jit-dbg = "/usr/bin/mono*.mdb \
+ /usr/bin/mono*/*.mdb"
+FILES_mono-jit = "/usr/bin/mono"
+FILES_mono-gac-dbg = "/usr/bin/gacutil*.mdb \
+ /usr/bin/gacutil*/*.mdb \
+ /usr/lib/mono/1.0/gacutil.exe*.mdb \
+ /usr/lib/mono/1.0/gacutil.exe*/*.mdb"
+FILES_mono-gac = "/usr/bin/gacutil \
+ /usr/lib/mono/1.0/gacutil.exe"
+FILES_mono-mjs-dbg = "/usr/bin/mjs*.mdb \
+ /usr/bin/mjs*/*.mdb \
+ /usr/lib/mono/1.0/mjs.exe*.mdb \
+ /usr/lib/mono/1.0/mjs.exe*/*.mdb"
+FILES_mono-mjs = "/usr/bin/mjs \
+ /usr/lib/mono/1.0/mjs.exe*"
+FILES_mono-gmcs-dbg = "/usr/bin/gmcs*.mdb \
+ /usr/bin/gmcs*/*.mdb \
+ /usr/bin/wsdl2*.mdb \
+ /usr/bin/wsdl2*/*.mdb \
+ /usr/bin/monop2*.mdb \
+ /usr/bin/monop2*/*.mdb \
+ /usr/bin/ilasm2*.mdb \
+ /usr/bin/ilasm2*/*.mdb \
+ /usr/bin/resgen2*.mdb \
+ /usr/bin/resgen2*/*.mdb \
+ /usr/bin/mono-api-info2*.mdb \
+ /usr/bin/mono-api-info2*/*.mdb \
+ /usr/bin/mono-service2*.mdb \
+ /usr/bin/mono-service2*/*.mdb \
+ /usr/bin/mkbundle2*.mdb \
+ /usr/bin/mkbundle2*/*.mdb \
+ /usr/bin/xbuild*.mdb \
+ /usr/bin/xbuild*/*.mdb \
+ /usr/bin/sgen*.mdb \
+ /usr/bin/sgen*/*.mdb \
+ /usr/bin/al2*.mdb \
+ /usr/bin/al2*/*.mdb \
+ /usr/bin/httpcfg*.mdb \
+ /usr/bin/httpcfg*/*.mdb \
+ /usr/lib/mono/2.0/*.exe*.mdb \
+ /usr/lib/mono/2.0/*.exe*/*.mdb \
+ /usr/lib/mono/2.0/xbuild.rsp*.mdb \
+ /usr/lib/mono/2.0/xbuild.rsp*/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/*/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/.debug/ \
+ /usr/lib/mono/2.0/MSBuild/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.targets*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets*/*.mdb"
+FILES_mono-gmcs = "/usr/bin/gmcs \
+ /usr/bin/wsdl2 \
+ /usr/bin/monop2 \
+ /usr/bin/ilasm2 \
+ /usr/bin/resgen2 \
+ /usr/bin/mono-api-info2 \
+ /usr/bin/mono-service2 \
+ /usr/bin/mkbundle2 \
+ /usr/bin/xbuild \
+ /usr/bin/sgen \
+ /usr/bin/al2 \
+ /usr/bin/httpcfg \
+ /usr/lib/mono/2.0/*.exe* \
+ /usr/lib/mono/2.0/xbuild.rsp \
+ /usr/lib/mono/2.0/MSBuild/ \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks \
+ /usr/lib/mono/2.0/Microsoft.Common.targets \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets"
+FILES_mono-utils-dbg = "/usr/bin/pedump*.mdb \
+ /usr/bin/pedump*/*.mdb \
+ /usr/bin/monodis*.mdb \
+ /usr/bin/monodis*/*.mdb \
+ /usr/bin/monograph*.mdb \
+ /usr/bin/monograph*/*.mdb \
+ /usr/bin/mono-find-provides*.mdb \
+ /usr/bin/mono-find-provides*/*.mdb \
+ /usr/bin/mono-find-requires*.mdb \
+ /usr/bin/mono-find-requires*/*.mdb"
+FILES_mono-utils = "/usr/bin/pedump \
+ /usr/bin/monodis \
+ /usr/bin/monograph \
+ /usr/bin/mono-find-provides \
+ /usr/bin/mono-find-requires"
+FILES_libmono-peapi1.0-cil-dbg = "/usr/lib/mono/gac/PEAPI/1.0.*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/1.0.*/.debug/ \
+ /usr/lib/mono/gac/PEAPI/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/PEAPI.dll*.mdb \
+ /usr/lib/mono/1.0/PEAPI.dll*/*.mdb"
+FILES_libmono-peapi1.0-cil = "/usr/lib/mono/gac/PEAPI/1.0.*/ \
+ /usr/lib/mono/1.0/PEAPI.dll"
+FILES_libmono-cairo1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Cairo/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Cairo.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Cairo.dll*/*.mdb \
+ /usr/lib/pkgconfig/mono-cairo.pc*.mdb \
+ /usr/lib/pkgconfig/mono-cairo.pc*/*.mdb"
+FILES_libmono-cairo1.0-cil = "/usr/lib/mono/gac/Mono.Cairo/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Cairo.dll \
+ /usr/lib/pkgconfig/mono-cairo.pc"
+FILES_libmono-system-web2.0-cil-dbg = "/usr/lib/mono/gac/System.Web/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Web.dll*.mdb \
+ /usr/lib/mono/2.0/System.Web.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Web.Services.dll*.mdb \
+ /usr/lib/mono/2.0/System.Web.Services.dll*/*.mdb"
+FILES_libmono-system-web2.0-cil = "/usr/lib/mono/gac/System.Web/2.0.*/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/ \
+ /usr/lib/mono/2.0/System.Web.dll \
+ /usr/lib/mono/2.0/System.Web.Services.dll"
+FILES_libmono-accessibility2.0-cil-dbg = "/usr/lib/mono/gac/Accessibility/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Accessibility/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Accessibility.dll*.mdb \
+ /usr/lib/mono/2.0/Accessibility.dll*/*.mdb"
+FILES_libmono-accessibility2.0-cil = "/usr/lib/mono/gac/Accessibility/2.0.*/ \
+ /usr/lib/mono/2.0/Accessibility.dll"
+FILES_libmono-microsoft7.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.JScript/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll*/*.mdb \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll*/*.mdb \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll*/*.mdb"
+FILES_libmono-microsoft7.0-cil = "/usr/lib/mono/gac/Microsoft.JScript/7.0.*/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/ \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll"
+FILES_libmono-winforms2.0-cil-dbg = "/usr/lib/mono/gac/System.Windows.Forms/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Design/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Design/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll*.mdb \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll*.mdb \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Design.dll*.mdb \
+ /usr/lib/mono/2.0/System.Design.dll*/*.mdb"
+FILES_libmono-winforms2.0-cil = "/usr/lib/mono/gac/System.Windows.Forms/2.0.*/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/ \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll \
+ /usr/lib/mono/2.0/System.Design.dll"
+FILES_libmono-ldap1.0-cil-dbg = "/usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll*.mdb \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll*/*.mdb"
+FILES_libmono-ldap1.0-cil = "/usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/ \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll"
+FILES_libmono-sharpzip2.84-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/../.debug/ \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip2.84-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/ \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-system-data2.0-cil-dbg = "/usr/lib/mono/gac/System.Data/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Data.dll*.mdb \
+ /usr/lib/mono/2.0/System.Data.dll*/*.mdb"
+FILES_libmono-system-data2.0-cil = "/usr/lib/mono/gac/System.Data/2.0.*/ \
+ /usr/lib/mono/2.0/System.Data.dll"
+FILES_libmono-corlib2.0-cil-dbg = "/usr/lib/mono/gac/I18N*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/I18N*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/I18N*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/I18N*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/I18N*.dll*.mdb \
+ /usr/lib/mono/2.0/I18N*.dll*/*.mdb \
+ /usr/lib/mono/2.0/mscorlib.dll*.mdb \
+ /usr/lib/mono/2.0/mscorlib.dll*/*.mdb"
+FILES_libmono-corlib2.0-cil = "/usr/lib/mono/gac/I18N*/2.0.*/ \
+ /usr/lib/mono/2.0/I18N*.dll \
+ /usr/lib/mono/2.0/mscorlib.dll*"
+FILES_libmono-winforms1.0-cil-dbg = "/usr/lib/mono/gac/System.Windows.Forms/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Design/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Design/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll*.mdb \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll*.mdb \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Design.dll*.mdb \
+ /usr/lib/mono/1.0/System.Design.dll*/*.mdb"
+FILES_libmono-winforms1.0-cil = "/usr/lib/mono/gac/System.Windows.Forms/1.0.*/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/ \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll \
+ /usr/lib/mono/1.0/System.Design.dll"
+FILES_libmono-microsoft8.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.JScript/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll*/*.mdb"
+FILES_libmono-microsoft8.0-cil = "/usr/lib/mono/gac/Microsoft.JScript/8.0.*/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/ \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll"
+FILES_libmono-corlib1.0-cil-dbg = "/usr/lib/mono/gac/I18N*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/I18N*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/I18N*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/I18N*/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/I18N*.dll*.mdb \
+ /usr/lib/mono/1.0/I18N*.dll*/*.mdb \
+ /usr/lib/mono/1.0/mscorlib.dll*.mdb \
+ /usr/lib/mono/1.0/mscorlib.dll*/*.mdb"
+FILES_libmono-corlib1.0-cil = "/usr/lib/mono/gac/I18N*/1.0.*/ \
+ /usr/lib/mono/1.0/I18N*.dll \
+ /usr/lib/mono/1.0/mscorlib.dll*"
+FILES_libmono-system-web1.0-cil-dbg = "/usr/lib/mono/gac/System.Web/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Web.dll*.mdb \
+ /usr/lib/mono/1.0/System.Web.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Web.Services.dll*.mdb \
+ /usr/lib/mono/1.0/System.Web.Services.dll*/*.mdb"
+FILES_libmono-system-web1.0-cil = "/usr/lib/mono/gac/System.Web/1.0.*/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/ \
+ /usr/lib/mono/1.0/System.Web.dll \
+ /usr/lib/mono/1.0/System.Web.Services.dll"
+FILES_libmono-system-runtime2.0-cil-dbg = "/usr/lib/mono/gac/System.Runtime.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Runtime.*.dll*.mdb \
+ /usr/lib/mono/2.0/System.Runtime.*.dll*/*.mdb"
+FILES_libmono-system-runtime2.0-cil = "/usr/lib/mono/gac/System.Runtime.*/2.0.*/ \
+ /usr/lib/mono/2.0/System.Runtime.*.dll"
+FILES_libmono-cscompmgd8.0-cil-dbg = "/usr/lib/mono/gac/cscompmgd/8.0.*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/.debug/ \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/../.debug/ \
+ /usr/lib/mono/2.0/cscompmgd.dll*.mdb \
+ /usr/lib/mono/2.0/cscompmgd.dll*/*.mdb"
+FILES_libmono-cscompmgd8.0-cil = "/usr/lib/mono/gac/cscompmgd/8.0.*/ \
+ /usr/lib/mono/2.0/cscompmgd.dll"
+FILES_libmono-cscompmgd7.0-cil-dbg = "/usr/lib/mono/gac/cscompmgd/7.0.*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/.debug/ \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/../.debug/ \
+ /usr/lib/mono/1.0/cscompmgd.dll*.mdb \
+ /usr/lib/mono/1.0/cscompmgd.dll*/*.mdb"
+FILES_libmono-cscompmgd7.0-cil = "/usr/lib/mono/gac/cscompmgd/7.0.*/ \
+ /usr/lib/mono/1.0/cscompmgd.dll"
+FILES_libmono-firebirdsql1.7-cil-dbg = "/usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/*.mdb \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/*/*.mdb \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/.debug/ \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/../.debug/ \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll*.mdb \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll*/*.mdb"
+FILES_libmono-firebirdsql1.7-cil = "/usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/ \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll"
+FILES_mono-jay-dbg = "/usr/bin/jay*.mdb \
+ /usr/bin/jay*/*.mdb"
+FILES_mono-jay = "/usr/bin/jay"
+FILES_libmono-data-tds1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Tds/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll*/*.mdb"
+FILES_libmono-data-tds1.0-cil = "/usr/lib/mono/gac/Mono.Data.Tds/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll"
+FILES_libmono-sqlite1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll*/*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll*/*.mdb"
+FILES_libmono-sqlite1.0-cil = "/usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll"
+FILES_libmono-relaxng1.0-cil-dbg = "/usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll*.mdb \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll*/*.mdb"
+FILES_libmono-relaxng1.0-cil = "/usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/ \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll"
+FILES_libmono-dev-dbg = "/usr/lib/libmono*.a*.mdb \
+ /usr/lib/libmono*.a*/*.mdb \
+ /usr/lib/libMono*.a*.mdb \
+ /usr/lib/libMono*.a*/*.mdb \
+ /usr/lib/libmono*.so*.mdb \
+ /usr/lib/libmono*.so*/*.mdb \
+ /usr/lib/libMonoSupportW.a*.mdb \
+ /usr/lib/libMonoSupportW.a*/*.mdb \
+ /usr/lib/pkgconfig/mono.pc*.mdb \
+ /usr/lib/pkgconfig/mono.pc*/*.mdb \
+ /usr/lib/pkgconfig/dotnet.pc*.mdb \
+ /usr/lib/pkgconfig/dotnet.pc*/*.mdb \
+ /usr/include/*.mdb \
+ /usr/include/*/*.mdb \
+ /usr/include/.debug/ \
+ /usr/include/../.debug/"
+FILES_libmono-dev = "/usr/lib/libmono*.a \
+ /usr/lib/libMono*.a \
+ /usr/lib/libmono*.so \
+ /usr/lib/libMonoSupportW.a \
+ /usr/lib/pkgconfig/mono.pc \
+ /usr/lib/pkgconfig/dotnet.pc \
+ /usr/include/"
+FILES_libmono-accessibility1.0-cil-dbg = "/usr/lib/mono/gac/Accessibility/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Accessibility/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Accessibility.dll*.mdb \
+ /usr/lib/mono/1.0/Accessibility.dll*/*.mdb"
+FILES_libmono-accessibility1.0-cil = "/usr/lib/mono/gac/Accessibility/1.0.*/ \
+ /usr/lib/mono/1.0/Accessibility.dll"
+FILES_mono-common-dbg = "/etc/mono*.mdb \
+ /etc/mono*/*.mdb \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml*.mdb \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml*/*.mdb"
+FILES_mono-common = "/etc/mono \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml"
+FILES_libmono-oracle1.0-cil-dbg = "/usr/lib/mono/gac/System.Data.OracleClient/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll*.mdb \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll*/*.mdb"
+FILES_libmono-oracle1.0-cil = "/usr/lib/mono/gac/System.Data.OracleClient/1.0.*/ \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll"
+FILES_libmono-system-data1.0-cil-dbg = "/usr/lib/mono/gac/System.Data/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Data.dll*.mdb \
+ /usr/lib/mono/1.0/System.Data.dll*/*.mdb"
+FILES_libmono-system-data1.0-cil = "/usr/lib/mono/gac/System.Data/1.0.*/ \
+ /usr/lib/mono/1.0/System.Data.dll"
+FILES_libmono-bytefx0.7.6.2-cil-dbg = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/.debug/ \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/../.debug/ \
+ /usr/lib/mono/2.0/ByteFX.Data.dll*.mdb \
+ /usr/lib/mono/2.0/ByteFX.Data.dll*/*.mdb"
+FILES_libmono-bytefx0.7.6.2-cil = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/ \
+ /usr/lib/mono/2.0/ByteFX.Data.dll"
+FILES_libmono0-dbg = "/usr/lib/libmono*.so.*.mdb \
+ /usr/lib/libmono*.so.*/*.mdb \
+ /usr/lib/libMonoPosixHelper.so*.mdb \
+ /usr/lib/libMonoPosixHelper.so*/*.mdb \
+ /usr/lib/libMonoSupportW.so*.mdb \
+ /usr/lib/libMonoSupportW.so*/*.mdb"
+FILES_libmono0 = "/usr/lib/libmono*.so.* \
+ /usr/lib/libMonoPosixHelper.so \
+ /usr/lib/libMonoSupportW.so"
+FILES_libmono-sharpzip0.6-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/../.debug/ \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip0.6-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/ \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-data-tds2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Tds/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll*/*.mdb"
+FILES_libmono-data-tds2.0-cil = "/usr/lib/mono/gac/Mono.Data.Tds/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll"
+FILES_libmono-system-messaging1.0-cil-dbg = "/usr/lib/mono/gac/System.Messaging/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Messaging.dll*.mdb \
+ /usr/lib/mono/1.0/System.Messaging.dll*/*.mdb"
+FILES_libmono-system-messaging1.0-cil = "/usr/lib/mono/gac/System.Messaging/1.0.*/ \
+ /usr/lib/mono/1.0/System.Messaging.dll"
+FILES_libmono-npgsql1.0-cil-dbg = "/usr/lib/mono/gac/Npgsql/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Npgsql/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Npgsql.dll*.mdb \
+ /usr/lib/mono/1.0/Npgsql.dll*/*.mdb"
+FILES_libmono-npgsql1.0-cil = "/usr/lib/mono/gac/Npgsql/1.0.*/ \
+ /usr/lib/mono/1.0/Npgsql.dll"
+FILES_libmono-security2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Security/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Security.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Security.dll*/*.mdb"
+FILES_libmono-security2.0-cil = "/usr/lib/mono/gac/Mono.Security/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Security.dll"
+FILES_libmono-security1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Security/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Security.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Security.dll*/*.mdb"
+FILES_libmono-security1.0-cil = "/usr/lib/mono/gac/Mono.Security/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Security.dll"
+FILES_libmono-bytefx0.7.6.1-cil-dbg = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/.debug/ \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/../.debug/ \
+ /usr/lib/mono/1.0/ByteFX.Data.dll*.mdb \
+ /usr/lib/mono/1.0/ByteFX.Data.dll*/*.mdb"
+FILES_libmono-bytefx0.7.6.1-cil = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/ \
+ /usr/lib/mono/1.0/ByteFX.Data.dll"
+FILES_libmono-microsoft-build2.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.Build.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll*/*.mdb"
+FILES_libmono-microsoft-build2.0-cil = "/usr/lib/mono/gac/Microsoft.Build.*/2.0.*/ \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll"
+FILES_libmono-system-ldap1.0-cil-dbg = "/usr/lib/mono/gac/System.DirectoryServices/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll*.mdb \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll*/*.mdb"
+FILES_libmono-system-ldap1.0-cil = "/usr/lib/mono/gac/System.DirectoryServices/1.0.*/ \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll"
+FILES_libmono-relaxng2.0-cil-dbg = "/usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll*.mdb \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll*/*.mdb"
+FILES_libmono-relaxng2.0-cil = "/usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/ \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll"
+FILES_libmono-system-ldap2.0-cil-dbg = "/usr/lib/mono/gac/System.DirectoryServices/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll*.mdb \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll*/*.mdb"
+FILES_libmono-system-ldap2.0-cil = "/usr/lib/mono/gac/System.DirectoryServices/2.0.*/ \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll"
+FILES_libmono-system-messaging2.0-cil-dbg = "/usr/lib/mono/gac/System.Messaging/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Messaging.dll*.mdb \
+ /usr/lib/mono/2.0/System.Messaging.dll*/*.mdb"
+FILES_libmono-system-messaging2.0-cil = "/usr/lib/mono/gac/System.Messaging/2.0.*/ \
+ /usr/lib/mono/2.0/System.Messaging.dll"
+FILES_libmono-sharpzip0.84-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/../.debug/ \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip0.84-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/ \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-sqlite2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll*/*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll*/*.mdb"
+FILES_libmono-sqlite2.0-cil = "/usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll"
+FILES_libmono-ldap2.0-cil-dbg = "/usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll*.mdb \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll*/*.mdb"
+FILES_libmono-ldap2.0-cil = "/usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/ \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll"
+FILES_libmono-npgsql2.0-cil-dbg = "/usr/lib/mono/gac/Npgsql/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Npgsql/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Npgsql.dll*.mdb \
+ /usr/lib/mono/2.0/Npgsql.dll*/*.mdb"
+FILES_libmono-npgsql2.0-cil = "/usr/lib/mono/gac/Npgsql/2.0.*/ \
+ /usr/lib/mono/2.0/Npgsql.dll"
+FILES_libmono-system-runtime1.0-cil-dbg = "/usr/lib/mono/gac/System.Runtime.*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Runtime.*.dll*.mdb \
+ /usr/lib/mono/1.0/System.Runtime.*.dll*/*.mdb"
+FILES_libmono-system-runtime1.0-cil = "/usr/lib/mono/gac/System.Runtime.*/1.0.*/ \
+ /usr/lib/mono/1.0/System.Runtime.*.dll"
+FILES_libmono-oracle2.0-cil-dbg = "/usr/lib/mono/gac/System.Data.OracleClient/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll*.mdb \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll*/*.mdb"
+FILES_libmono-oracle2.0-cil = "/usr/lib/mono/gac/System.Data.OracleClient/2.0.*/ \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll"
+FILES_libmono-c5-1.0-cil-dbg = "/usr/lib/mono/gac/Mono.C5/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.C5.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.C5.dll*/*.mdb"
+FILES_libmono-c5-1.0-cil = "/usr/lib/mono/gac/Mono.C5/1.0.*/ \
+ /usr/lib/mono/2.0/Mono.C5.dll"
+FILES_libmono-sharpzip2.6-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/../.debug/ \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip2.6-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/ \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-cairo2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Cairo/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Cairo.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Cairo.dll*/*.mdb"
+FILES_libmono-cairo2.0-cil = "/usr/lib/mono/gac/Mono.Cairo/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Cairo.dll"
+FILES_libmono-peapi2.0-cil-dbg = "/usr/lib/mono/gac/PEAPI/2.0.*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/2.0.*/.debug/ \
+ /usr/lib/mono/gac/PEAPI/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/PEAPI.dll*.mdb \
+ /usr/lib/mono/2.0/PEAPI.dll*/*.mdb"
+FILES_libmono-peapi2.0-cil = "/usr/lib/mono/gac/PEAPI/2.0.*/ \
+ /usr/lib/mono/2.0/PEAPI.dll"
+FILES_mono-mcs-dbg = "/usr/bin/*.mdb \
+ /usr/bin/*/*.mdb \
+ /usr/bin/.debug/ \
+ /usr/bin/../.debug/ \
+ /usr/lib/mono/1.0/*.exe*.mdb \
+ /usr/lib/mono/1.0/*.exe*/*.mdb"
+FILES_mono-mcs = "/usr/bin/ \
+ /usr/lib/mono/1.0/*.exe*"
+FILES_libmono-system1.0-cil-dbg = "/usr/lib/mono/gac/System*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System*/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System*.dll*.mdb \
+ /usr/lib/mono/1.0/System*.dll*/*.mdb \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*.mdb \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*/*.mdb"
+FILES_libmono-system1.0-cil = "/usr/lib/mono/gac/System*/1.0.*/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/ \
+ /usr/lib/mono/1.0/System*.dll \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*"
+FILES_libmono-system2.0-cil-dbg = "/usr/lib/mono/gac/System*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System*/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System*.dll*.mdb \
+ /usr/lib/mono/2.0/System*.dll*/*.mdb \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*.mdb \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*/*.mdb"
+FILES_libmono-system2.0-cil = "/usr/lib/mono/gac/System*/2.0.*/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/ \
+ /usr/lib/mono/2.0/System*.dll \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*"
+FILES_libmono1.0-cil-dbg = "/usr/lib/mono/gac/Mono.*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.*/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.*.mdb \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/.debug/ \
+ /usr/lib/mono/gac/mono-service/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.*.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.*.dll*/*.mdb \
+ /usr/lib/mono/1.0/OpenSystem.C.dll*.mdb \
+ /usr/lib/mono/1.0/OpenSystem.C.dll*/*.mdb"
+FILES_libmono1.0-cil = "/usr/lib/mono/gac/Mono.*/1.0.*/ \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.* \
+ /usr/lib/mono/gac/mono-service/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.*.dll \
+ /usr/lib/mono/1.0/OpenSystem.C.dll"
+FILES_libmono2.0-cil-dbg = "/usr/lib/mono/gac/Mono.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.*/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.*.mdb \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/.debug/ \
+ /usr/lib/mono/gac/mono-service/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.*.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.*.dll*/*.mdb \
+ /usr/lib/mono/2.0/OpenSystem.C.dll*.mdb \
+ /usr/lib/mono/2.0/OpenSystem.C.dll*/*.mdb"
+FILES_libmono2.0-cil = "/usr/lib/mono/gac/Mono.*/2.0.*/ \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.* \
+ /usr/lib/mono/gac/mono-service/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.*.dll \
+ /usr/lib/mono/2.0/OpenSystem.C.dll"
+
+PACKAGES = "mono-jit-dbg \
+ mono-jit \
+ mono-gac-dbg \
+ mono-gac \
+ mono-mjs-dbg \
+ mono-mjs \
+ mono-gmcs-dbg \
+ mono-gmcs \
+ mono-utils-dbg \
+ mono-utils \
+ libmono-peapi1.0-cil-dbg \
+ libmono-peapi1.0-cil \
+ libmono-cairo1.0-cil-dbg \
+ libmono-cairo1.0-cil \
+ libmono-system-web2.0-cil-dbg \
+ libmono-system-web2.0-cil \
+ libmono-accessibility2.0-cil-dbg \
+ libmono-accessibility2.0-cil \
+ libmono-microsoft7.0-cil-dbg \
+ libmono-microsoft7.0-cil \
+ libmono-winforms2.0-cil-dbg \
+ libmono-winforms2.0-cil \
+ libmono-ldap1.0-cil-dbg \
+ libmono-ldap1.0-cil \
+ libmono-sharpzip2.84-cil-dbg \
+ libmono-sharpzip2.84-cil \
+ libmono-system-data2.0-cil-dbg \
+ libmono-system-data2.0-cil \
+ libmono-corlib2.0-cil-dbg \
+ libmono-corlib2.0-cil \
+ libmono-winforms1.0-cil-dbg \
+ libmono-winforms1.0-cil \
+ libmono-microsoft8.0-cil-dbg \
+ libmono-microsoft8.0-cil \
+ libmono-corlib1.0-cil-dbg \
+ libmono-corlib1.0-cil \
+ libmono-system-web1.0-cil-dbg \
+ libmono-system-web1.0-cil \
+ libmono-system-runtime2.0-cil-dbg \
+ libmono-system-runtime2.0-cil \
+ libmono-cscompmgd8.0-cil-dbg \
+ libmono-cscompmgd8.0-cil \
+ libmono-cscompmgd7.0-cil-dbg \
+ libmono-cscompmgd7.0-cil \
+ libmono-firebirdsql1.7-cil-dbg \
+ libmono-firebirdsql1.7-cil \
+ mono-jay-dbg \
+ mono-jay \
+ libmono-data-tds1.0-cil-dbg \
+ libmono-data-tds1.0-cil \
+ libmono-sqlite1.0-cil-dbg \
+ libmono-sqlite1.0-cil \
+ libmono-relaxng1.0-cil-dbg \
+ libmono-relaxng1.0-cil \
+ libmono-dev-dbg \
+ libmono-dev \
+ libmono-accessibility1.0-cil-dbg \
+ libmono-accessibility1.0-cil \
+ mono-common-dbg \
+ mono-common \
+ libmono-oracle1.0-cil-dbg \
+ libmono-oracle1.0-cil \
+ libmono-system-data1.0-cil-dbg \
+ libmono-system-data1.0-cil \
+ libmono-bytefx0.7.6.2-cil-dbg \
+ libmono-bytefx0.7.6.2-cil \
+ libmono0-dbg \
+ libmono0 \
+ libmono-sharpzip0.6-cil-dbg \
+ libmono-sharpzip0.6-cil \
+ libmono-data-tds2.0-cil-dbg \
+ libmono-data-tds2.0-cil \
+ libmono-system-messaging1.0-cil-dbg \
+ libmono-system-messaging1.0-cil \
+ libmono-npgsql1.0-cil-dbg \
+ libmono-npgsql1.0-cil \
+ libmono-security2.0-cil-dbg \
+ libmono-security2.0-cil \
+ libmono-security1.0-cil-dbg \
+ libmono-security1.0-cil \
+ libmono-bytefx0.7.6.1-cil-dbg \
+ libmono-bytefx0.7.6.1-cil \
+ libmono-microsoft-build2.0-cil-dbg \
+ libmono-microsoft-build2.0-cil \
+ libmono-system-ldap1.0-cil-dbg \
+ libmono-system-ldap1.0-cil \
+ libmono-relaxng2.0-cil-dbg \
+ libmono-relaxng2.0-cil \
+ libmono-system-ldap2.0-cil-dbg \
+ libmono-system-ldap2.0-cil \
+ libmono-system-messaging2.0-cil-dbg \
+ libmono-system-messaging2.0-cil \
+ libmono-sharpzip0.84-cil-dbg \
+ libmono-sharpzip0.84-cil \
+ libmono-sqlite2.0-cil-dbg \
+ libmono-sqlite2.0-cil \
+ libmono-ldap2.0-cil-dbg \
+ libmono-ldap2.0-cil \
+ libmono-npgsql2.0-cil-dbg \
+ libmono-npgsql2.0-cil \
+ libmono-system-runtime1.0-cil-dbg \
+ libmono-system-runtime1.0-cil \
+ libmono-oracle2.0-cil-dbg \
+ libmono-oracle2.0-cil \
+ libmono-c5-1.0-cil-dbg \
+ libmono-c5-1.0-cil \
+ libmono-sharpzip2.6-cil-dbg \
+ libmono-sharpzip2.6-cil \
+ libmono-cairo2.0-cil-dbg \
+ libmono-cairo2.0-cil \
+ libmono-peapi2.0-cil-dbg \
+ libmono-peapi2.0-cil \
+ mono-mcs-dbg \
+ mono-mcs \
+ libmono-system1.0-cil-dbg \
+ libmono-system1.0-cil \
+ libmono-system2.0-cil-dbg \
+ libmono-system2.0-cil \
+ libmono1.0-cil-dbg \
+ libmono1.0-cil \
+ libmono2.0-cil-dbg \
+ libmono2.0-cil"
+# This is a generated file, please do not edit directly
+# Use collect-files.py instead. -- Henryk <henryk@openmoko.org>
+FILES_mono-jit-dbg = "/usr/bin/mono*.mdb \
+ /usr/bin/mono*/*.mdb"
+FILES_mono-jit = "/usr/bin/mono"
+FILES_mono-gac-dbg = "/usr/bin/gacutil*.mdb \
+ /usr/bin/gacutil*/*.mdb \
+ /usr/lib/mono/1.0/gacutil.exe*.mdb \
+ /usr/lib/mono/1.0/gacutil.exe*/*.mdb"
+FILES_mono-gac = "/usr/bin/gacutil \
+ /usr/lib/mono/1.0/gacutil.exe"
+FILES_mono-mjs-dbg = "/usr/bin/mjs*.mdb \
+ /usr/bin/mjs*/*.mdb \
+ /usr/lib/mono/1.0/mjs.exe*.mdb \
+ /usr/lib/mono/1.0/mjs.exe*/*.mdb"
+FILES_mono-mjs = "/usr/bin/mjs \
+ /usr/lib/mono/1.0/mjs.exe*"
+FILES_mono-gmcs-dbg = "/usr/bin/gmcs*.mdb \
+ /usr/bin/gmcs*/*.mdb \
+ /usr/bin/wsdl2*.mdb \
+ /usr/bin/wsdl2*/*.mdb \
+ /usr/bin/monop2*.mdb \
+ /usr/bin/monop2*/*.mdb \
+ /usr/bin/ilasm2*.mdb \
+ /usr/bin/ilasm2*/*.mdb \
+ /usr/bin/resgen2*.mdb \
+ /usr/bin/resgen2*/*.mdb \
+ /usr/bin/mono-api-info2*.mdb \
+ /usr/bin/mono-api-info2*/*.mdb \
+ /usr/bin/mono-service2*.mdb \
+ /usr/bin/mono-service2*/*.mdb \
+ /usr/bin/mkbundle2*.mdb \
+ /usr/bin/mkbundle2*/*.mdb \
+ /usr/bin/xbuild*.mdb \
+ /usr/bin/xbuild*/*.mdb \
+ /usr/bin/sgen*.mdb \
+ /usr/bin/sgen*/*.mdb \
+ /usr/bin/al2*.mdb \
+ /usr/bin/al2*/*.mdb \
+ /usr/bin/httpcfg*.mdb \
+ /usr/bin/httpcfg*/*.mdb \
+ /usr/lib/mono/2.0/*.exe*.mdb \
+ /usr/lib/mono/2.0/*.exe*/*.mdb \
+ /usr/lib/mono/2.0/xbuild.rsp*.mdb \
+ /usr/lib/mono/2.0/xbuild.rsp*/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/*/*.mdb \
+ /usr/lib/mono/2.0/MSBuild/.debug/ \
+ /usr/lib/mono/2.0/MSBuild/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Common.targets*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets*/*.mdb"
+FILES_mono-gmcs = "/usr/bin/gmcs \
+ /usr/bin/wsdl2 \
+ /usr/bin/monop2 \
+ /usr/bin/ilasm2 \
+ /usr/bin/resgen2 \
+ /usr/bin/mono-api-info2 \
+ /usr/bin/mono-service2 \
+ /usr/bin/mkbundle2 \
+ /usr/bin/xbuild \
+ /usr/bin/sgen \
+ /usr/bin/al2 \
+ /usr/bin/httpcfg \
+ /usr/lib/mono/2.0/*.exe* \
+ /usr/lib/mono/2.0/xbuild.rsp \
+ /usr/lib/mono/2.0/MSBuild/ \
+ /usr/lib/mono/2.0/Microsoft.Build.xsd \
+ /usr/lib/mono/2.0/Microsoft.CSharp.targets \
+ /usr/lib/mono/2.0/Microsoft.Common.tasks \
+ /usr/lib/mono/2.0/Microsoft.Common.targets \
+ /usr/lib/mono/2.0/Microsoft.VisualBasic.targets"
+FILES_mono-utils-dbg = "/usr/bin/pedump*.mdb \
+ /usr/bin/pedump*/*.mdb \
+ /usr/bin/monodis*.mdb \
+ /usr/bin/monodis*/*.mdb \
+ /usr/bin/monograph*.mdb \
+ /usr/bin/monograph*/*.mdb \
+ /usr/bin/mono-find-provides*.mdb \
+ /usr/bin/mono-find-provides*/*.mdb \
+ /usr/bin/mono-find-requires*.mdb \
+ /usr/bin/mono-find-requires*/*.mdb"
+FILES_mono-utils = "/usr/bin/pedump \
+ /usr/bin/monodis \
+ /usr/bin/monograph \
+ /usr/bin/mono-find-provides \
+ /usr/bin/mono-find-requires"
+FILES_libmono-peapi1.0-cil-dbg = "/usr/lib/mono/gac/PEAPI/1.0.*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/1.0.*/.debug/ \
+ /usr/lib/mono/gac/PEAPI/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/PEAPI.dll*.mdb \
+ /usr/lib/mono/1.0/PEAPI.dll*/*.mdb"
+FILES_libmono-peapi1.0-cil = "/usr/lib/mono/gac/PEAPI/1.0.*/ \
+ /usr/lib/mono/1.0/PEAPI.dll"
+FILES_libmono-cairo1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Cairo/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Cairo/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Cairo.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Cairo.dll*/*.mdb \
+ /usr/lib/pkgconfig/mono-cairo.pc*.mdb \
+ /usr/lib/pkgconfig/mono-cairo.pc*/*.mdb"
+FILES_libmono-cairo1.0-cil = "/usr/lib/mono/gac/Mono.Cairo/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Cairo.dll \
+ /usr/lib/pkgconfig/mono-cairo.pc"
+FILES_libmono-system-web2.0-cil-dbg = "/usr/lib/mono/gac/System.Web/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Web.dll*.mdb \
+ /usr/lib/mono/2.0/System.Web.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Web.Services.dll*.mdb \
+ /usr/lib/mono/2.0/System.Web.Services.dll*/*.mdb"
+FILES_libmono-system-web2.0-cil = "/usr/lib/mono/gac/System.Web/2.0.*/ \
+ /usr/lib/mono/gac/System.Web.Services/2.0.*/ \
+ /usr/lib/mono/2.0/System.Web.dll \
+ /usr/lib/mono/2.0/System.Web.Services.dll"
+FILES_libmono-accessibility2.0-cil-dbg = "/usr/lib/mono/gac/Accessibility/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Accessibility/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Accessibility.dll*.mdb \
+ /usr/lib/mono/2.0/Accessibility.dll*/*.mdb"
+FILES_libmono-accessibility2.0-cil = "/usr/lib/mono/gac/Accessibility/2.0.*/ \
+ /usr/lib/mono/2.0/Accessibility.dll"
+FILES_libmono-microsoft7.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.JScript/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.JScript/7.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll*/*.mdb \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll*/*.mdb \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll*.mdb \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll*/*.mdb"
+FILES_libmono-microsoft7.0-cil = "/usr/lib/mono/gac/Microsoft.JScript/7.0.*/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/7.0.*/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/7.0.*/ \
+ /usr/lib/mono/1.0/Microsoft.JScript.dll \
+ /usr/lib/mono/1.0/Microsoft.VisualC.dll \
+ /usr/lib/mono/1.0/Microsoft.Vsa.dll"
+FILES_libmono-winforms2.0-cil-dbg = "/usr/lib/mono/gac/System.Windows.Forms/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Windows.Forms/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Design/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Design/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll*.mdb \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll*.mdb \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll*/*.mdb \
+ /usr/lib/mono/2.0/System.Design.dll*.mdb \
+ /usr/lib/mono/2.0/System.Design.dll*/*.mdb"
+FILES_libmono-winforms2.0-cil = "/usr/lib/mono/gac/System.Windows.Forms/2.0.*/ \
+ /usr/lib/mono/gac/System.Drawing.Design/2.0.*/ \
+ /usr/lib/mono/gac/System.Design/2.0.*/ \
+ /usr/lib/mono/2.0/System.Windows.Forms.dll \
+ /usr/lib/mono/2.0/System.Drawing.Design.dll \
+ /usr/lib/mono/2.0/System.Design.dll"
+FILES_libmono-ldap1.0-cil-dbg = "/usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll*.mdb \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll*/*.mdb"
+FILES_libmono-ldap1.0-cil = "/usr/lib/mono/gac/Novell.Directory.Ldap/1.0.*/ \
+ /usr/lib/mono/1.0/Novell.Directory.Ldap.dll"
+FILES_libmono-sharpzip2.84-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/../.debug/ \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip2.84-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.84.*/ \
+ /usr/lib/mono/2.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-system-data2.0-cil-dbg = "/usr/lib/mono/gac/System.Data/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Data.dll*.mdb \
+ /usr/lib/mono/2.0/System.Data.dll*/*.mdb"
+FILES_libmono-system-data2.0-cil = "/usr/lib/mono/gac/System.Data/2.0.*/ \
+ /usr/lib/mono/2.0/System.Data.dll"
+FILES_libmono-corlib2.0-cil-dbg = "/usr/lib/mono/gac/I18N*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/I18N*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/I18N*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/I18N*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/I18N*.dll*.mdb \
+ /usr/lib/mono/2.0/I18N*.dll*/*.mdb \
+ /usr/lib/mono/2.0/mscorlib.dll*.mdb \
+ /usr/lib/mono/2.0/mscorlib.dll*/*.mdb"
+FILES_libmono-corlib2.0-cil = "/usr/lib/mono/gac/I18N*/2.0.*/ \
+ /usr/lib/mono/2.0/I18N*.dll \
+ /usr/lib/mono/2.0/mscorlib.dll*"
+FILES_libmono-winforms1.0-cil-dbg = "/usr/lib/mono/gac/System.Windows.Forms/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Windows.Forms/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Design/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Design/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll*.mdb \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll*.mdb \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Design.dll*.mdb \
+ /usr/lib/mono/1.0/System.Design.dll*/*.mdb"
+FILES_libmono-winforms1.0-cil = "/usr/lib/mono/gac/System.Windows.Forms/1.0.*/ \
+ /usr/lib/mono/gac/System.Drawing.Design/1.0.*/ \
+ /usr/lib/mono/gac/System.Design/1.0.*/ \
+ /usr/lib/mono/1.0/System.Windows.Forms.dll \
+ /usr/lib/mono/1.0/System.Drawing.Design.dll \
+ /usr/lib/mono/1.0/System.Design.dll"
+FILES_libmono-microsoft8.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.JScript/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.JScript/8.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/../.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll*/*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll*/*.mdb"
+FILES_libmono-microsoft8.0-cil = "/usr/lib/mono/gac/Microsoft.JScript/8.0.*/ \
+ /usr/lib/mono/gac/Microsoft.VisualC/8.0.*/ \
+ /usr/lib/mono/gac/Microsoft.Vsa/8.0.*/ \
+ /usr/lib/mono/2.0/Microsoft.JScript.dll \
+ /usr/lib/mono/2.0/Microsoft.VisualC.dll \
+ /usr/lib/mono/2.0/Microsoft.Vsa.dll"
+FILES_libmono-corlib1.0-cil-dbg = "/usr/lib/mono/gac/I18N*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/I18N*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/I18N*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/I18N*/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/I18N*.dll*.mdb \
+ /usr/lib/mono/1.0/I18N*.dll*/*.mdb \
+ /usr/lib/mono/1.0/mscorlib.dll*.mdb \
+ /usr/lib/mono/1.0/mscorlib.dll*/*.mdb"
+FILES_libmono-corlib1.0-cil = "/usr/lib/mono/gac/I18N*/1.0.*/ \
+ /usr/lib/mono/1.0/I18N*.dll \
+ /usr/lib/mono/1.0/mscorlib.dll*"
+FILES_libmono-system-web1.0-cil-dbg = "/usr/lib/mono/gac/System.Web/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Web.dll*.mdb \
+ /usr/lib/mono/1.0/System.Web.dll*/*.mdb \
+ /usr/lib/mono/1.0/System.Web.Services.dll*.mdb \
+ /usr/lib/mono/1.0/System.Web.Services.dll*/*.mdb"
+FILES_libmono-system-web1.0-cil = "/usr/lib/mono/gac/System.Web/1.0.*/ \
+ /usr/lib/mono/gac/System.Web.Services/1.0.*/ \
+ /usr/lib/mono/1.0/System.Web.dll \
+ /usr/lib/mono/1.0/System.Web.Services.dll"
+FILES_libmono-system-runtime2.0-cil-dbg = "/usr/lib/mono/gac/System.Runtime.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Runtime.*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Runtime.*.dll*.mdb \
+ /usr/lib/mono/2.0/System.Runtime.*.dll*/*.mdb"
+FILES_libmono-system-runtime2.0-cil = "/usr/lib/mono/gac/System.Runtime.*/2.0.*/ \
+ /usr/lib/mono/2.0/System.Runtime.*.dll"
+FILES_libmono-cscompmgd8.0-cil-dbg = "/usr/lib/mono/gac/cscompmgd/8.0.*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/.debug/ \
+ /usr/lib/mono/gac/cscompmgd/8.0.*/../.debug/ \
+ /usr/lib/mono/2.0/cscompmgd.dll*.mdb \
+ /usr/lib/mono/2.0/cscompmgd.dll*/*.mdb"
+FILES_libmono-cscompmgd8.0-cil = "/usr/lib/mono/gac/cscompmgd/8.0.*/ \
+ /usr/lib/mono/2.0/cscompmgd.dll"
+FILES_libmono-cscompmgd7.0-cil-dbg = "/usr/lib/mono/gac/cscompmgd/7.0.*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/*/*.mdb \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/.debug/ \
+ /usr/lib/mono/gac/cscompmgd/7.0.*/../.debug/ \
+ /usr/lib/mono/1.0/cscompmgd.dll*.mdb \
+ /usr/lib/mono/1.0/cscompmgd.dll*/*.mdb"
+FILES_libmono-cscompmgd7.0-cil = "/usr/lib/mono/gac/cscompmgd/7.0.*/ \
+ /usr/lib/mono/1.0/cscompmgd.dll"
+FILES_libmono-firebirdsql1.7-cil-dbg = "/usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/*.mdb \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/*/*.mdb \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/.debug/ \
+ /usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/../.debug/ \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll*.mdb \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll*/*.mdb"
+FILES_libmono-firebirdsql1.7-cil = "/usr/lib/mono/gac/FirebirdSql.Data.Firebird/1.7.*/ \
+ /usr/lib/mono/1.0/FirebirdSql.Data.Firebird.dll"
+FILES_mono-jay-dbg = "/usr/bin/jay*.mdb \
+ /usr/bin/jay*/*.mdb"
+FILES_mono-jay = "/usr/bin/jay"
+FILES_libmono-data-tds1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Tds/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Tds/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll*/*.mdb"
+FILES_libmono-data-tds1.0-cil = "/usr/lib/mono/gac/Mono.Data.Tds/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Data.Tds.dll"
+FILES_libmono-sqlite1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll*/*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll*/*.mdb"
+FILES_libmono-sqlite1.0-cil = "/usr/lib/mono/gac/Mono.Data.Sqlite/1.0.*/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Data.Sqlite.dll \
+ /usr/lib/mono/1.0/Mono.Data.SqliteClient.dll"
+FILES_libmono-relaxng1.0-cil-dbg = "/usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll*.mdb \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll*/*.mdb"
+FILES_libmono-relaxng1.0-cil = "/usr/lib/mono/gac/Commons.Xml.Relaxng/1.0.*/ \
+ /usr/lib/mono/1.0/Commons.Xml.Relaxng.dll"
+FILES_libmono-dev-dbg = "/usr/lib/libmono*.a*.mdb \
+ /usr/lib/libmono*.a*/*.mdb \
+ /usr/lib/libMono*.a*.mdb \
+ /usr/lib/libMono*.a*/*.mdb \
+ /usr/lib/libmono*.so*.mdb \
+ /usr/lib/libmono*.so*/*.mdb \
+ /usr/lib/libMonoSupportW.a*.mdb \
+ /usr/lib/libMonoSupportW.a*/*.mdb \
+ /usr/lib/pkgconfig/mono.pc*.mdb \
+ /usr/lib/pkgconfig/mono.pc*/*.mdb \
+ /usr/lib/pkgconfig/dotnet.pc*.mdb \
+ /usr/lib/pkgconfig/dotnet.pc*/*.mdb \
+ /usr/include/*.mdb \
+ /usr/include/*/*.mdb \
+ /usr/include/.debug/ \
+ /usr/include/../.debug/"
+FILES_libmono-dev = "/usr/lib/libmono*.a \
+ /usr/lib/libMono*.a \
+ /usr/lib/libmono*.so \
+ /usr/lib/libMonoSupportW.a \
+ /usr/lib/pkgconfig/mono.pc \
+ /usr/lib/pkgconfig/dotnet.pc \
+ /usr/include/"
+FILES_libmono-accessibility1.0-cil-dbg = "/usr/lib/mono/gac/Accessibility/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Accessibility/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Accessibility/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Accessibility.dll*.mdb \
+ /usr/lib/mono/1.0/Accessibility.dll*/*.mdb"
+FILES_libmono-accessibility1.0-cil = "/usr/lib/mono/gac/Accessibility/1.0.*/ \
+ /usr/lib/mono/1.0/Accessibility.dll"
+FILES_mono-common-dbg = "/etc/mono*.mdb \
+ /etc/mono*/*.mdb \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml*.mdb \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml*/*.mdb"
+FILES_mono-common = "/etc/mono \
+ /usr/share/mono-1.0/mono/cil/cil-opcodes.xml"
+FILES_libmono-oracle1.0-cil-dbg = "/usr/lib/mono/gac/System.Data.OracleClient/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data.OracleClient/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll*.mdb \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll*/*.mdb"
+FILES_libmono-oracle1.0-cil = "/usr/lib/mono/gac/System.Data.OracleClient/1.0.*/ \
+ /usr/lib/mono/1.0/System.Data.OracleClient.dll"
+FILES_libmono-system-data1.0-cil-dbg = "/usr/lib/mono/gac/System.Data/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Data.dll*.mdb \
+ /usr/lib/mono/1.0/System.Data.dll*/*.mdb"
+FILES_libmono-system-data1.0-cil = "/usr/lib/mono/gac/System.Data/1.0.*/ \
+ /usr/lib/mono/1.0/System.Data.dll"
+FILES_libmono-bytefx0.7.6.2-cil-dbg = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/.debug/ \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/../.debug/ \
+ /usr/lib/mono/2.0/ByteFX.Data.dll*.mdb \
+ /usr/lib/mono/2.0/ByteFX.Data.dll*/*.mdb"
+FILES_libmono-bytefx0.7.6.2-cil = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.2*/ \
+ /usr/lib/mono/2.0/ByteFX.Data.dll"
+FILES_libmono0-dbg = "/usr/lib/libmono*.so.*.mdb \
+ /usr/lib/libmono*.so.*/*.mdb \
+ /usr/lib/libMonoPosixHelper.so*.mdb \
+ /usr/lib/libMonoPosixHelper.so*/*.mdb \
+ /usr/lib/libMonoSupportW.so*.mdb \
+ /usr/lib/libMonoSupportW.so*/*.mdb"
+FILES_libmono0 = "/usr/lib/libmono*.so.* \
+ /usr/lib/libMonoPosixHelper.so \
+ /usr/lib/libMonoSupportW.so"
+FILES_libmono-sharpzip0.6-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/../.debug/ \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip0.6-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.6.*/ \
+ /usr/lib/mono/compat-1.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-data-tds2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Tds/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Tds/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll*/*.mdb"
+FILES_libmono-data-tds2.0-cil = "/usr/lib/mono/gac/Mono.Data.Tds/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Data.Tds.dll"
+FILES_libmono-system-messaging1.0-cil-dbg = "/usr/lib/mono/gac/System.Messaging/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Messaging/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Messaging.dll*.mdb \
+ /usr/lib/mono/1.0/System.Messaging.dll*/*.mdb"
+FILES_libmono-system-messaging1.0-cil = "/usr/lib/mono/gac/System.Messaging/1.0.*/ \
+ /usr/lib/mono/1.0/System.Messaging.dll"
+FILES_libmono-npgsql1.0-cil-dbg = "/usr/lib/mono/gac/Npgsql/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Npgsql/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Npgsql.dll*.mdb \
+ /usr/lib/mono/1.0/Npgsql.dll*/*.mdb"
+FILES_libmono-npgsql1.0-cil = "/usr/lib/mono/gac/Npgsql/1.0.*/ \
+ /usr/lib/mono/1.0/Npgsql.dll"
+FILES_libmono-security2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Security/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Security/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Security.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Security.dll*/*.mdb"
+FILES_libmono-security2.0-cil = "/usr/lib/mono/gac/Mono.Security/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Security.dll"
+FILES_libmono-security1.0-cil-dbg = "/usr/lib/mono/gac/Mono.Security/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Security/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.Security.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.Security.dll*/*.mdb"
+FILES_libmono-security1.0-cil = "/usr/lib/mono/gac/Mono.Security/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.Security.dll"
+FILES_libmono-bytefx0.7.6.1-cil-dbg = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/*/*.mdb \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/.debug/ \
+ /usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/../.debug/ \
+ /usr/lib/mono/1.0/ByteFX.Data.dll*.mdb \
+ /usr/lib/mono/1.0/ByteFX.Data.dll*/*.mdb"
+FILES_libmono-bytefx0.7.6.1-cil = "/usr/lib/mono/gac/ByteFX.Data/0.7.6.1*/ \
+ /usr/lib/mono/1.0/ByteFX.Data.dll"
+FILES_libmono-microsoft-build2.0-cil-dbg = "/usr/lib/mono/gac/Microsoft.Build.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Microsoft.Build.*/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll*.mdb \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll*/*.mdb"
+FILES_libmono-microsoft-build2.0-cil = "/usr/lib/mono/gac/Microsoft.Build.*/2.0.*/ \
+ /usr/lib/mono/2.0/Microsoft.Build.*.dll"
+FILES_libmono-system-ldap1.0-cil-dbg = "/usr/lib/mono/gac/System.DirectoryServices/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.DirectoryServices/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll*.mdb \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll*/*.mdb"
+FILES_libmono-system-ldap1.0-cil = "/usr/lib/mono/gac/System.DirectoryServices/1.0.*/ \
+ /usr/lib/mono/1.0/System.DirectoryServices.dll"
+FILES_libmono-relaxng2.0-cil-dbg = "/usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll*.mdb \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll*/*.mdb"
+FILES_libmono-relaxng2.0-cil = "/usr/lib/mono/gac/Commons.Xml.Relaxng/2.0.*/ \
+ /usr/lib/mono/2.0/Commons.Xml.Relaxng.dll"
+FILES_libmono-system-ldap2.0-cil-dbg = "/usr/lib/mono/gac/System.DirectoryServices/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.DirectoryServices/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll*.mdb \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll*/*.mdb"
+FILES_libmono-system-ldap2.0-cil = "/usr/lib/mono/gac/System.DirectoryServices/2.0.*/ \
+ /usr/lib/mono/2.0/System.DirectoryServices.dll"
+FILES_libmono-system-messaging2.0-cil-dbg = "/usr/lib/mono/gac/System.Messaging/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Messaging/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Messaging.dll*.mdb \
+ /usr/lib/mono/2.0/System.Messaging.dll*/*.mdb"
+FILES_libmono-system-messaging2.0-cil = "/usr/lib/mono/gac/System.Messaging/2.0.*/ \
+ /usr/lib/mono/2.0/System.Messaging.dll"
+FILES_libmono-sharpzip0.84-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/../.debug/ \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip0.84-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/0.84.*/ \
+ /usr/lib/mono/1.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-sqlite2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll*/*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll*/*.mdb"
+FILES_libmono-sqlite2.0-cil = "/usr/lib/mono/gac/Mono.Data.Sqlite/2.0.*/ \
+ /usr/lib/mono/gac/Mono.Data.SqliteClient/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Data.Sqlite.dll \
+ /usr/lib/mono/2.0/Mono.Data.SqliteClient.dll"
+FILES_libmono-ldap2.0-cil-dbg = "/usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll*.mdb \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll*/*.mdb"
+FILES_libmono-ldap2.0-cil = "/usr/lib/mono/gac/Novell.Directory.Ldap/2.0.*/ \
+ /usr/lib/mono/2.0/Novell.Directory.Ldap.dll"
+FILES_libmono-npgsql2.0-cil-dbg = "/usr/lib/mono/gac/Npgsql/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Npgsql/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Npgsql/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Npgsql.dll*.mdb \
+ /usr/lib/mono/2.0/Npgsql.dll*/*.mdb"
+FILES_libmono-npgsql2.0-cil = "/usr/lib/mono/gac/Npgsql/2.0.*/ \
+ /usr/lib/mono/2.0/Npgsql.dll"
+FILES_libmono-system-runtime1.0-cil-dbg = "/usr/lib/mono/gac/System.Runtime.*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Runtime.*/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System.Runtime.*.dll*.mdb \
+ /usr/lib/mono/1.0/System.Runtime.*.dll*/*.mdb"
+FILES_libmono-system-runtime1.0-cil = "/usr/lib/mono/gac/System.Runtime.*/1.0.*/ \
+ /usr/lib/mono/1.0/System.Runtime.*.dll"
+FILES_libmono-oracle2.0-cil-dbg = "/usr/lib/mono/gac/System.Data.OracleClient/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System.Data.OracleClient/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll*.mdb \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll*/*.mdb"
+FILES_libmono-oracle2.0-cil = "/usr/lib/mono/gac/System.Data.OracleClient/2.0.*/ \
+ /usr/lib/mono/2.0/System.Data.OracleClient.dll"
+FILES_libmono-c5-1.0-cil-dbg = "/usr/lib/mono/gac/Mono.C5/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.C5/1.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.C5.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.C5.dll*/*.mdb"
+FILES_libmono-c5-1.0-cil = "/usr/lib/mono/gac/Mono.C5/1.0.*/ \
+ /usr/lib/mono/2.0/Mono.C5.dll"
+FILES_libmono-sharpzip2.6-cil-dbg = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/*/*.mdb \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/.debug/ \
+ /usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/../.debug/ \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll*.mdb \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll*/*.mdb"
+FILES_libmono-sharpzip2.6-cil = "/usr/lib/mono/gac/ICSharpCode.SharpZipLib/2.6.*/ \
+ /usr/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll"
+FILES_libmono-cairo2.0-cil-dbg = "/usr/lib/mono/gac/Mono.Cairo/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.Cairo/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.Cairo.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.Cairo.dll*/*.mdb"
+FILES_libmono-cairo2.0-cil = "/usr/lib/mono/gac/Mono.Cairo/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.Cairo.dll"
+FILES_libmono-peapi2.0-cil-dbg = "/usr/lib/mono/gac/PEAPI/2.0.*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/PEAPI/2.0.*/.debug/ \
+ /usr/lib/mono/gac/PEAPI/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/PEAPI.dll*.mdb \
+ /usr/lib/mono/2.0/PEAPI.dll*/*.mdb"
+FILES_libmono-peapi2.0-cil = "/usr/lib/mono/gac/PEAPI/2.0.*/ \
+ /usr/lib/mono/2.0/PEAPI.dll"
+FILES_mono-mcs-dbg = "/usr/bin/*.mdb \
+ /usr/bin/*/*.mdb \
+ /usr/bin/.debug/ \
+ /usr/bin/../.debug/ \
+ /usr/lib/mono/1.0/*.exe*.mdb \
+ /usr/lib/mono/1.0/*.exe*/*.mdb"
+FILES_mono-mcs = "/usr/bin/ \
+ /usr/lib/mono/1.0/*.exe*"
+FILES_libmono-system1.0-cil-dbg = "/usr/lib/mono/gac/System*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/System*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/System*/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/System*.dll*.mdb \
+ /usr/lib/mono/1.0/System*.dll*/*.mdb \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*.mdb \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*/*.mdb"
+FILES_libmono-system1.0-cil = "/usr/lib/mono/gac/System*/1.0.*/ \
+ /usr/lib/mono/gac/CustomMarshalers/1.0.*/ \
+ /usr/lib/mono/1.0/System*.dll \
+ /usr/lib/mono/1.0/CustomMarshalers.dll*"
+FILES_libmono-system2.0-cil-dbg = "/usr/lib/mono/gac/System*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/System*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/System*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/System*/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/.debug/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/System*.dll*.mdb \
+ /usr/lib/mono/2.0/System*.dll*/*.mdb \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*.mdb \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*/*.mdb"
+FILES_libmono-system2.0-cil = "/usr/lib/mono/gac/System*/2.0.*/ \
+ /usr/lib/mono/gac/CustomMarshalers/2.0.*/ \
+ /usr/lib/mono/2.0/System*.dll \
+ /usr/lib/mono/2.0/CustomMarshalers.dll*"
+FILES_libmono1.0-cil-dbg = "/usr/lib/mono/gac/Mono.*/1.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/1.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.*/1.0.*/../.debug/ \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.*.mdb \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/*/*.mdb \
+ /usr/lib/mono/gac/mono-service/1.0.*/.debug/ \
+ /usr/lib/mono/gac/mono-service/1.0.*/../.debug/ \
+ /usr/lib/mono/1.0/Mono.*.dll*.mdb \
+ /usr/lib/mono/1.0/Mono.*.dll*/*.mdb \
+ /usr/lib/mono/1.0/OpenSystem.C.dll*.mdb \
+ /usr/lib/mono/1.0/OpenSystem.C.dll*/*.mdb"
+FILES_libmono1.0-cil = "/usr/lib/mono/gac/Mono.*/1.0.*/ \
+ /usr/lib/mono/gac/OpenSystem.C/1.0.* \
+ /usr/lib/mono/gac/mono-service/1.0.*/ \
+ /usr/lib/mono/1.0/Mono.*.dll \
+ /usr/lib/mono/1.0/OpenSystem.C.dll"
+FILES_libmono2.0-cil-dbg = "/usr/lib/mono/gac/Mono.*/2.0.*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/Mono.*/2.0.*/.debug/ \
+ /usr/lib/mono/gac/Mono.*/2.0.*/../.debug/ \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.*.mdb \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/*/*.mdb \
+ /usr/lib/mono/gac/mono-service/2.0.*/.debug/ \
+ /usr/lib/mono/gac/mono-service/2.0.*/../.debug/ \
+ /usr/lib/mono/2.0/Mono.*.dll*.mdb \
+ /usr/lib/mono/2.0/Mono.*.dll*/*.mdb \
+ /usr/lib/mono/2.0/OpenSystem.C.dll*.mdb \
+ /usr/lib/mono/2.0/OpenSystem.C.dll*/*.mdb"
+FILES_libmono2.0-cil = "/usr/lib/mono/gac/Mono.*/2.0.*/ \
+ /usr/lib/mono/gac/OpenSystem.C/2.0.* \
+ /usr/lib/mono/gac/mono-service/2.0.*/ \
+ /usr/lib/mono/2.0/Mono.*.dll \
+ /usr/lib/mono/2.0/OpenSystem.C.dll"
+
+PACKAGES = "mono-jit-dbg \
+ mono-jit \
+ mono-gac-dbg \
+ mono-gac \
+ mono-mjs-dbg \
+ mono-mjs \
+ mono-gmcs-dbg \
+ mono-gmcs \
+ mono-utils-dbg \
+ mono-utils \
+ libmono-peapi1.0-cil-dbg \
+ libmono-peapi1.0-cil \
+ libmono-cairo1.0-cil-dbg \
+ libmono-cairo1.0-cil \
+ libmono-system-web2.0-cil-dbg \
+ libmono-system-web2.0-cil \
+ libmono-accessibility2.0-cil-dbg \
+ libmono-accessibility2.0-cil \
+ libmono-microsoft7.0-cil-dbg \
+ libmono-microsoft7.0-cil \
+ libmono-winforms2.0-cil-dbg \
+ libmono-winforms2.0-cil \
+ libmono-ldap1.0-cil-dbg \
+ libmono-ldap1.0-cil \
+ libmono-sharpzip2.84-cil-dbg \
+ libmono-sharpzip2.84-cil \
+ libmono-system-data2.0-cil-dbg \
+ libmono-system-data2.0-cil \
+ libmono-corlib2.0-cil-dbg \
+ libmono-corlib2.0-cil \
+ libmono-winforms1.0-cil-dbg \
+ libmono-winforms1.0-cil \
+ libmono-microsoft8.0-cil-dbg \
+ libmono-microsoft8.0-cil \
+ libmono-corlib1.0-cil-dbg \
+ libmono-corlib1.0-cil \
+ libmono-system-web1.0-cil-dbg \
+ libmono-system-web1.0-cil \
+ libmono-system-runtime2.0-cil-dbg \
+ libmono-system-runtime2.0-cil \
+ libmono-cscompmgd8.0-cil-dbg \
+ libmono-cscompmgd8.0-cil \
+ libmono-cscompmgd7.0-cil-dbg \
+ libmono-cscompmgd7.0-cil \
+ libmono-firebirdsql1.7-cil-dbg \
+ libmono-firebirdsql1.7-cil \
+ mono-jay-dbg \
+ mono-jay \
+ libmono-data-tds1.0-cil-dbg \
+ libmono-data-tds1.0-cil \
+ libmono-sqlite1.0-cil-dbg \
+ libmono-sqlite1.0-cil \
+ libmono-relaxng1.0-cil-dbg \
+ libmono-relaxng1.0-cil \
+ libmono-dev-dbg \
+ libmono-dev \
+ libmono-accessibility1.0-cil-dbg \
+ libmono-accessibility1.0-cil \
+ mono-common-dbg \
+ mono-common \
+ libmono-oracle1.0-cil-dbg \
+ libmono-oracle1.0-cil \
+ libmono-system-data1.0-cil-dbg \
+ libmono-system-data1.0-cil \
+ libmono-bytefx0.7.6.2-cil-dbg \
+ libmono-bytefx0.7.6.2-cil \
+ libmono0-dbg \
+ libmono0 \
+ libmono-sharpzip0.6-cil-dbg \
+ libmono-sharpzip0.6-cil \
+ libmono-data-tds2.0-cil-dbg \
+ libmono-data-tds2.0-cil \
+ libmono-system-messaging1.0-cil-dbg \
+ libmono-system-messaging1.0-cil \
+ libmono-npgsql1.0-cil-dbg \
+ libmono-npgsql1.0-cil \
+ libmono-security2.0-cil-dbg \
+ libmono-security2.0-cil \
+ libmono-security1.0-cil-dbg \
+ libmono-security1.0-cil \
+ libmono-bytefx0.7.6.1-cil-dbg \
+ libmono-bytefx0.7.6.1-cil \
+ libmono-microsoft-build2.0-cil-dbg \
+ libmono-microsoft-build2.0-cil \
+ libmono-system-ldap1.0-cil-dbg \
+ libmono-system-ldap1.0-cil \
+ libmono-relaxng2.0-cil-dbg \
+ libmono-relaxng2.0-cil \
+ libmono-system-ldap2.0-cil-dbg \
+ libmono-system-ldap2.0-cil \
+ libmono-system-messaging2.0-cil-dbg \
+ libmono-system-messaging2.0-cil \
+ libmono-sharpzip0.84-cil-dbg \
+ libmono-sharpzip0.84-cil \
+ libmono-sqlite2.0-cil-dbg \
+ libmono-sqlite2.0-cil \
+ libmono-ldap2.0-cil-dbg \
+ libmono-ldap2.0-cil \
+ libmono-npgsql2.0-cil-dbg \
+ libmono-npgsql2.0-cil \
+ libmono-system-runtime1.0-cil-dbg \
+ libmono-system-runtime1.0-cil \
+ libmono-oracle2.0-cil-dbg \
+ libmono-oracle2.0-cil \
+ libmono-c5-1.0-cil-dbg \
+ libmono-c5-1.0-cil \
+ libmono-sharpzip2.6-cil-dbg \
+ libmono-sharpzip2.6-cil \
+ libmono-cairo2.0-cil-dbg \
+ libmono-cairo2.0-cil \
+ libmono-peapi2.0-cil-dbg \
+ libmono-peapi2.0-cil \
+ mono-mcs-dbg \
+ mono-mcs \
+ libmono-system1.0-cil-dbg \
+ libmono-system1.0-cil \
+ libmono-system2.0-cil-dbg \
+ libmono-system2.0-cil \
+ libmono1.0-cil-dbg \
+ libmono1.0-cil \
+ libmono2.0-cil-dbg \
+ libmono2.0-cil"
diff --git a/packages/mono/mono_1.2.5.1.bb b/packages/mono/mono_1.2.5.1.bb
index c3ea1818ad..1d58c2d810 100644
--- a/packages/mono/mono_1.2.5.1.bb
+++ b/packages/mono/mono_1.2.5.1.bb
@@ -2,7 +2,7 @@ require mono_1.2.5.inc
DEPENDS = "mono-native mono-mcs-intermediate glib-2.0 perl-native"
-PR = "r2"
+PR = "r3"
SRC_URI += "file://configure.patch;patch=1 \
file://genmdesc-cpp.patch;patch=1"
@@ -35,11 +35,16 @@ do_install_append() {
}
inherit mono
-PACKAGES = "${@" ".join([e["name"] for e in mono_get_file_table(bb.data.getVar('PV', d, 1), d) if e.has_key("name")])}"
+
+# Import file definitions from Debian
+require mono_1.2.5.1-files.inc
+
+# Add some packages
+PACKAGES_append = " mono-doc mono mono-runtime"
FILES_mono-doc_append = " /usr/share/libgc-mono/ "
-FILES_mono = "" # Apparently this gets ignored, so I'm setting it again below
+FILES_mono = ""
ALLOW_EMPTY_mono = "1"
RDEPENDS_mono = "mono-common mono-jit"
@@ -49,98 +54,26 @@ RDEPENDS_mono-runtime = "mono-jit mono-gac"
RDEPENDS_mono-jit = "mono-common"
-FILES_libmono-dev = "/usr/lib/libmono.la /usr/lib/libmono-profiler-cov.la /usr/lib/libmono-profiler-aot.la \
+FILES_libmono-dev =+ " /usr/lib/libmono.la /usr/lib/libmono-profiler-cov.la /usr/lib/libmono-profiler-aot.la \
/usr/lib/libMonoPosixHelper.la /usr/lib/libMonoSupportW.la"
-FILES_libmono-dbg = "/usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \
+FILES_libmono-dbg =+ " /usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \
/usr/lib/.debug/libMonoPosixHelper.so /usr/lib/.debug/libMonoSupportW.so"
-python populate_packages_prepend () {
- def fillin_packages():
- # A lot of this code can probably be replaced with less code and some
- # calls to do_split_packages
- import bb, sys, os, glob, commands
-
- PV = bb.data.getVar('PV', d, 1)
-
- file_table = mono_get_file_table(PV, d)
- packages_to_add = []
-
- D = bb.data.getVar('D', d, 1)
- if not D: return
- D = D + "/"
-
- def classify_files(files):
- normal, dev, dbg, doc = [], [], [], []
- for filename in files:
- if filename.endswith(".mdb"):
- dbg.append(filename)
- elif os.path.basename( os.path.dirname( filename ) ) == ".debug":
- dbg.append(filename)
- elif filename.endswith(".pc"):
- dev.append(filename)
- else:
- normal.append(filename)
- return normal, dev, dbg, doc
-
- def will_strip(filename):
- # From package.bbclass function runstrip
- pathprefix = "export PATH=%s; " % bb.data.getVar('PATH', d, 1)
- ret, result = commands.getstatusoutput("%sfile '%s'" % (pathprefix, filename))
- if "not stripped" in result:
- return True
- else:
- return False
-
- def append(name, value):
- oldvalue = bb.data.getVar(name, d, 1) or ""
- newvalue = " ".join([oldvalue, value])
- bb.data.setVar(name, newvalue, d)
-
- already_covered = []
- for package in file_table:
- pn = package["name"]
- if package.has_key("patterns"):
- files = []
- for pattern in package["patterns"]:
- matching = glob.glob( D + pattern )
- for filename in matching:
- if os.path.isdir(filename):
- for dirpath, dirnames, filenames in os.walk(filename):
- for f in filenames:
- debugname = os.path.join(dirpath, ".debug", f)
- fullname = os.path.join(dirpath, f)
- files.append(fullname)
- if will_strip(fullname):
- files.append(debugname)
- else:
- files.append(filename)
-
- # Remove the D prefix
- files = [ e[len(D):] for e in files ]
-
- # Remove files that have already been placed in other packages
- files = [ e for e in files if not e in already_covered ]
- already_covered.extend( files )
-
- if pn.endswith("-dev") or pn.endswith("-dbg") or pn.endswith("-doc"):
- normal, dev, dbg, doc = files, [], [], []
- else:
- normal, dev, dbg, doc = classify_files(files)
-
- for extension, filelist in [ ("",normal), ("-dev", dev), ("-dbg", dbg), ("-doc", doc)]:
- if len(filelist) > 0:
- packagename = pn + extension
- append("FILES_%s" % packagename, " ".join(filelist))
- bb.debug(2, "%s\n\t%s" %( packagename, "\n\t".join( filelist ) ))
- if not packagename in packages_to_add:
- packages_to_add.append(packagename)
-
- else:
- packages_to_add.append(pn)
-
- # mono is just a stub package
- bb.data.setVar("FILES_mono", "", d)
-
- bb.data.setVar("PACKAGES", " ".join(packages_to_add), d)
- fillin_packages()
-}
+# Packages not included in Debian
+PACKAGES_prepend = "libnunit2.2-cil-dbg libnunit2.2-cil-dev libnunit2.2-cil \
+ libmono-cecil0.5-cil-dbg libmono-cecil0.5-cil-dev libmono-cecil0.5-cil \
+ libmono-db2-1.0-cil-dbg libmono-db2-1.0-cil-dev libmono-db2-1.0-cil"
+
+FILES_libnunit2.2-cil = "/usr/lib/mono/gac/nunit.*/2.2.* /usr/lib/mono/1.0/nunit.*.dll"
+FILES_libnunit2.2-cil-dev = "/usr/lib/pkgconfig/mono-nunit.pc"
+FILES_libnunit2.2-cil-dbg = "/usr/lib/mono/gac/nunit*/2.2.*/nunit.*.dll.mdb"
+
+FILES_libmono-cecil0.5-cil = "/usr/lib/mono/gac/Mono.Cecil/0.5.*"
+FILES_libmono-cecil0.5-cil-dbg = "/usr/lib/mono/gac/Mono.Cecil/0.5.0.1__0738eb9f132ed756/Mono.Cecil.dll.mdb"
+
+FILES_libmono-db2-1.0-cil = "/usr/lib/mono/gac/IBM.Data.DB2/1.0* /usr/lib/mono/1.0/IBM.Data.DB2.dll"
+FILES_libmono-db2-1.0-cil-dbg = "/usr/lib/mono/gac/IBM.Data.DB2/1.0*/IBM.Data.DB2.dll.mdb"
+
+# Move .pc files
+FILES_libmono-cairo1.0-cil-dev = "/usr/lib/pkgconfig/mono-cairo.pc"
+PACKAGES =+ " libmono-cairo1.0-cil-dev "
diff --git a/packages/mplayer/files/mplayer-imageon-svn.patch b/packages/mplayer/files/mplayer-imageon-svn.patch
index c8bb8709cd..744a520b13 100644
--- a/packages/mplayer/files/mplayer-imageon-svn.patch
+++ b/packages/mplayer/files/mplayer-imageon-svn.patch
@@ -5,9 +5,9 @@
Index: trunk/configure
===================================================================
---- trunk.orig/configure
-+++ trunk/configure
-@@ -519,6 +519,7 @@ _svga=auto
+--- trunk.orig/configure 2007-10-07 20:31:56.000000000 +0100
++++ trunk/configure 2007-10-07 20:34:38.000000000 +0100
+@@ -545,6 +545,7 @@
_vesa=auto
_fbdev=auto
_w100=no
@@ -15,7 +15,7 @@ Index: trunk/configure
_dvb=auto
_dvbhead=auto
_dxr2=auto
-@@ -820,6 +821,8 @@ for ac_option do
+@@ -860,6 +861,8 @@
--disable-fbdev) _fbdev=no ;;
--enable-w100) _w100=yes ;;
--disable-w100) _w100=no ;;
@@ -24,7 +24,7 @@ Index: trunk/configure
--enable-dvb) _dvb=yes ;;
--disable-dvb) _dvb=no ;;
--enable-dvbhead) _dvbhead=yes ;;
-@@ -4329,6 +4332,18 @@ else
+@@ -4447,6 +4450,19 @@
fi
echores "$_w100"
@@ -32,6 +32,7 @@ Index: trunk/configure
+if test "$_imageon" = yes ; then
+ _def_imageon='#define HAVE_IMAGEON 1'
+ _ld_imageon='-lw100'
++ _libs_mplayer="$_libs_mplayer $_ld_imageon"
+ _vosrc="$_vosrc vo_imageon.c"
+ _vomodules="imageon $_vomodules"
+else
@@ -43,8 +44,8 @@ Index: trunk/configure
echocheck "DVB"
if test "$_dvb" = auto ; then
-@@ -8355,6 +8370,7 @@ $_def_xmga
- $_def_syncfb
+@@ -8453,6 +8469,7 @@
+ $_def_xmga
$_def_fbdev
$_def_w100
+$_def_imageon
@@ -53,8 +54,8 @@ Index: trunk/configure
$_def_ivtv
Index: trunk/libvo/vo_imageon.c
===================================================================
---- /dev/null
-+++ trunk/libvo/vo_imageon.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ trunk/libvo/vo_imageon.c 2007-10-07 20:31:57.000000000 +0100
@@ -0,0 +1,308 @@
+#include <stdio.h>
+#include <stdlib.h>
diff --git a/packages/mplayer/files/pxa_configure.patch b/packages/mplayer/files/pxa_configure.patch
index 85530b77c5..079d3086de 100644
--- a/packages/mplayer/files/pxa_configure.patch
+++ b/packages/mplayer/files/pxa_configure.patch
@@ -25,11 +25,11 @@ Index: MPlayer-1.0rc1/configure
+echocheck "PXA27x Overlay Support"
+if test "$_pxa" = yes ; then
-+ _def_imageon='#define HAVE_PXA 1'
++ _def_pxa='#define HAVE_PXA 1'
+ _vosrc="$_vosrc vo_pxa.c"
+ _vomodules="pxa $_vomodules"
+else
-+ _def_imageon='#undef HAVE_IMAGEON'
++ _def_pxa='#undef HAVE_PXA'
+ _novomodules="pxa $_novomodules"
+fi
+echores "$_pxa"
diff --git a/packages/mplayer/mplayer_svn.bb b/packages/mplayer/mplayer_svn.bb
index bd2bc96b52..e481247970 100644
--- a/packages/mplayer/mplayer_svn.bb
+++ b/packages/mplayer/mplayer_svn.bb
@@ -3,6 +3,9 @@ SECTION = "multimedia"
PRIORITY = "optional"
HOMEPAGE = "http://www.mplayerhq.hu/"
DEPENDS = "virtual/libsdl xsp libmad zlib libpng jpeg liba52 freetype fontconfig alsa-lib lzo ncurses lame libxv virtual/libx11"
+DEPENDS_append_c7x0 = " libw100 "
+DEPENDS_append_hx4700 = " libw100 "
+
RDEPENDS = "mplayer-common"
LICENSE = "GPL"
SRC_URI = "svn://svn.mplayerhq.hu/mplayer;module=trunk \
@@ -28,14 +31,16 @@ SRC_URI = "svn://svn.mplayerhq.hu/mplayer;module=trunk \
# discovers this is more general than please make this more general
# ie. for all armv4 machines.
SRC_URI_append_collie = "file://disable-executable-stack-test.patch;patch=1"
-PACKAGE_ARCH_mplayer_collie = "collie"
-PACKAGE_ARCH_mencoder_collie = "collie"
+
+PACKAGE_ARCH_collie = "collie"
+PACKAGE_ARCH_c7x0 = "c7x0"
+PACKAGE_ARCH_hx4700 = "hx4700"
RCONFLICTS_${PN} = "mplayer-atty"
RREPLACES_${PN} = "mplayer-atty"
PV = "0.0+1.0rc1+svnr${SRCREV}"
-PR = "r3"
+PR = "r5"
DEFAULT_PREFERENCE = "-1"
PARALLEL_MAKE = ""
@@ -165,13 +170,12 @@ EXTRA_OECONF = " \
--disable-win32waveout \
--enable-select \
\
- --disable-runtime-cpudetection \
"
EXTRA_OECONF_append_arm = " --disable-decoder=vorbis_decoder \
--disable-encoder=vorbis_encoder"
-
-EXTRA_OECONF_append_progear = " --disable-sse --disable-3dnow --disable-mmxext --disable-sse2"
+EXTRA_OECONF_append_c7x0 = " --enable-imageon "
+EXTRA_OECONF_append_hx4700 = " --enable-imageon "
#build with support for the iwmmxt instruction and pxa270fb overlay support (pxa270 and up)
#not every iwmmxt machine has the lcd connected to pxafb, but building the module doesn't hurt
@@ -182,6 +186,7 @@ MY_TARGET_CC_ARCH := "${TARGET_CC_ARCH}"
TARGET_CC_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', '-march=iwmmxt -mtune=iwmmxt', '${MY_TARGET_CC_ARCH}',d)}"
EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'iwmmxt', '--enable-pxa --enable-iwmmxt', '',d)} "
+EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '--enable-runtime-cpudetection', '',d)} "
do_configure() {
cp ${WORKDIR}/vo_w100.c ${S}/libvo
diff --git a/packages/mtd/mtd-utils-native.inc b/packages/mtd/mtd-utils-native.inc
index da9759f02f..8ac4673524 100644
--- a/packages/mtd/mtd-utils-native.inc
+++ b/packages/mtd/mtd-utils-native.inc
@@ -3,8 +3,12 @@ DEPENDS = "zlib-native lzo-native"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/mtd-utils"
do_stage () {
+ install -d ${STAGING_INCDIR}/mtd
+ for f in ${S}/include/mtd/*.h; do
+ install -m 0644 $f ${STAGING_INCDIR}/mtd/
+ done
for binary in ${mtd_utils}; do
install -m 0755 $binary ${STAGING_BINDIR}
done
}
- \ No newline at end of file
+
diff --git a/packages/mtd/mtd-utils-native_1.0.0+git.bb b/packages/mtd/mtd-utils-native_1.0.0+git.bb
index 6f9d71e10c..6e310cb1b4 100644
--- a/packages/mtd/mtd-utils-native_1.0.0+git.bb
+++ b/packages/mtd/mtd-utils-native_1.0.0+git.bb
@@ -1,2 +1,3 @@
require mtd-utils_${PV}.bb
require mtd-utils-native.inc
+
diff --git a/packages/mtd/mtd-utils_1.0.0+git.bb b/packages/mtd/mtd-utils_1.0.0+git.bb
index 8b14faa1d6..33f95853f6 100644
--- a/packages/mtd/mtd-utils_1.0.0+git.bb
+++ b/packages/mtd/mtd-utils_1.0.0+git.bb
@@ -3,7 +3,7 @@ SECTION = "base"
DEPENDS = "zlib lzo"
HOMEPAGE = "http://www.linux-mtd.infradead.org/"
LICENSE = "GPLv2"
-PR = "r5"
+PR = "r6"
# This is the default package, thus we lock to a specific git version so
# upstream changes will not break builds.
diff --git a/packages/musicpd/mpd-alsa_svn.bb b/packages/musicpd/mpd-alsa_svn.bb
index 932295c3a6..2a9c9ed729 100644
--- a/packages/musicpd/mpd-alsa_svn.bb
+++ b/packages/musicpd/mpd-alsa_svn.bb
@@ -2,9 +2,9 @@ DESCRIPTION = "Music Player Daemon (mpd). This version is configured for alsa su
HOMEPAGE = "http://www.musicpd.org"
SECTION = "console/multimedia"
LICENSE = "GPLv2"
-DEPENDS = "libvorbis libogg libid3tag libao-alsa zlib libmikmod libmad flac audiofile virtual/libiconv"
+DEPENDS = "libvorbis libogg libid3tag libao-alsa zlib libmad flac audiofile virtual/libiconv faad2"
RDEPENDS = "libao-alsa"
-PR = "r0"
+PR = "r1"
SRC_URI = "svn://svn.musicpd.org/mpd;module=trunk;proto=https \
file://mpd/mpd.init"
@@ -21,19 +21,25 @@ INITSCRIPT_NAME = "mpd"
# versions.
EXTRA_OECONF = "\
---disable-ogg \
---disable-oggvorbis \
+--enable-ogg \
+--enable-oggvorbis \
--disable-oggflac \
---disable-flac \
---without-faad \
---with-iconv-libraries=${STAGING_LIBDIR} \
---with-iconv-includes=${STAGING_INCDIR} \
+--enable-flac \
+--enable-faad \
--with-ao-libraries=${STAGING_LIBDIR} \
--with-ao-includes=${STAGING_INCDIR} \
+--with-iconv-libraries=${STAGING_LIBDIR} \
+--with-iconv-includes=${STAGING_INCDIR} \
--with-id3tag-libraries=${STAGING_LIBDIR} \
--with-id3tag-includes=${STAGING_INCDIR} \
+--with-faad-libraries=${STAGING_LIBDIR} \
+--with-faad-includes=${STAGING_INCDIR} \
--with-mad-libraries=${STAGING_LIBDIR} \
--with-mad-includes=${STAGING_INCDIR} \
+--with-ogg-libraries=${STAGING_LIBDIR} \
+--with-ogg-includes=${STAGING_INCDIR} \
+--with-vorbis-libraries=${STAGING_LIBDIR} \
+--with-vorbis-includes=${STAGING_INCDIR} \
--disable-aotest \
--disable-alsatest \
--disable-oggtest \
diff --git a/packages/openmoko-panel-plugins/openmoko-panel-bt_svn.bb b/packages/openmoko-panel-plugins/openmoko-panel-bt_svn.bb
index e87a26230f..abd2654ce9 100644
--- a/packages/openmoko-panel-plugins/openmoko-panel-bt_svn.bb
+++ b/packages/openmoko-panel-plugins/openmoko-panel-bt_svn.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Shows the bluetooth status in the OpenMoko panel"
-DEPENDS = "bluez-libs"
+DEPENDS = "bluez-libs libnotify"
PV = "0.1.0+svn${SVNREV}"
PR = "r1"
diff --git a/packages/openmoko2/libmokojournal2_svn.bb b/packages/openmoko2/libmokojournal2_svn.bb
index 6e5383af83..09e249ff4f 100644
--- a/packages/openmoko2/libmokojournal2_svn.bb
+++ b/packages/openmoko2/libmokojournal2_svn.bb
@@ -5,6 +5,10 @@ PR = "r2"
inherit openmoko2 lib_package
+do_configure_prepend() {
+ touch gtk-doc.make
+}
+
do_stage() {
autotools_stage_all
}
diff --git a/packages/openmoko2/openmoko-sound-system2/session b/packages/openmoko2/openmoko-sound-system2/session
index dfef83d934..ed2346d55f 100644
--- a/packages/openmoko2/openmoko-sound-system2/session
+++ b/packages/openmoko2/openmoko-sound-system2/session
@@ -22,7 +22,7 @@ load-sample-lazy x11-bell /usr/share/openmoko/sounds/notify_doorbell.wav
load-module module-x11-bell sample=x11-bell
# Load samples
-load-sample startup /usr/share/openmoko/sounds/startup_openmoko.wav
+load-sample startup /usr/share/openmoko/sounds/startup_unintrusive.wav
load-sample touchscreen /usr/share/openmoko/sounds/touchscreen_click.wav
load-sample ringtone /usr/share/openmoko/sounds/ringtone_classy.wav
diff --git a/packages/openmoko2/openmoko-sound-system2_0.1.0.bb b/packages/openmoko2/openmoko-sound-system2_0.1.0.bb
index 35bfe66318..57b72af4b6 100644
--- a/packages/openmoko2/openmoko-sound-system2_0.1.0.bb
+++ b/packages/openmoko2/openmoko-sound-system2_0.1.0.bb
@@ -12,7 +12,7 @@ RDEPENDS = "\
"
RREPLACES = "openmoko-sound-system"
RPROVIDES = "openmoko-sound-system"
-PR = "r1"
+PR = "r2"
inherit openmoko-base update-rc.d
diff --git a/packages/openmoko2/openmoko-sound-theme-standard2_svn.bb b/packages/openmoko2/openmoko-sound-theme-standard2_svn.bb
index 0693b9bb8a..1cfb519c99 100644
--- a/packages/openmoko2/openmoko-sound-theme-standard2_svn.bb
+++ b/packages/openmoko2/openmoko-sound-theme-standard2_svn.bb
@@ -3,7 +3,7 @@ SECTION = "openmoko/base"
RREPLACES = "openmoko-sound-theme-standard"
RPROVIDES = "openmoko-sound-theme-standard"
PV = "0.1+svnr${SRCREV}"
-PR = "r1"
+PR = "r2"
inherit openmoko2 autotools
@@ -16,7 +16,7 @@ do_install() {
for i in *.mp3; do
cp -fpPR ${S}/$i ${D}${datadir}/openmoko/sounds/
done
- for i in touchscreen_click.wav ringtone_classy.wav notify_doorbell.wav startup_openmoko.wav; do
+ for i in touchscreen_click.wav ringtone_classy.wav notify_doorbell.wav startup_unintrusive.wav; do
cp -f ${S}/$i ${D}${datadir}/openmoko/sounds/
done
}
diff --git a/packages/python/python-pygobject-native_2.12.2.bb b/packages/python/python-pygobject-native_2.12.2.bb
deleted file mode 100644
index c93950b31b..0000000000
--- a/packages/python/python-pygobject-native_2.12.2.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require python-pygobject_${PV}.bb
-
-DEPENDS = "python-native"
diff --git a/packages/python/python-pygobject-native_2.12.3.bb b/packages/python/python-pygobject-native_2.12.3.bb
index 86d778c5ab..cb879fdeb1 100644
--- a/packages/python/python-pygobject-native_2.12.3.bb
+++ b/packages/python/python-pygobject-native_2.12.3.bb
@@ -1,6 +1,6 @@
require python-pygobject_${PV}.bb
-DEPENDS = "python-native"
+DEPENDS = "python-native glib-2.0-native"
SRC_URI = "ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.12/pygobject-${PV}.tar.bz2 "
diff --git a/packages/python/python-pygobject_2.12.2.bb b/packages/python/python-pygobject_2.12.2.bb
deleted file mode 100644
index 1604b54715..0000000000
--- a/packages/python/python-pygobject_2.12.2.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-DESCRIPTION = "Python GObject bindings"
-SECTION = "devel/python"
-LICENSE = "LGPL"
-DEPENDS = "python-pygobject-native"
-PR = "ml2"
-
-SRC_URI = "ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.12/pygobject-${PV}.tar.bz2"
-S = "${WORKDIR}/pygobject-${PV}"
-
-inherit autotools distutils-base pkgconfig
-
-# otherwise the main package keeps snatching the .pc file away
-# and therefore depends on glib-2.0-dev (which only the -dev
-# package should).
-PACKAGES =+ "${PN}-dev"
-
-do_stage() {
- autotools_stage_all
- install -d ${STAGING_LIBDIR}/../share/pygobject/
- cp -dpfR docs/* ${STAGING_LIBDIR}/../share/pygobject/
- install -d ${STAGING_LIBDIR}/../share/gtk-doc/html/pygobject/
- cp docs/style.css ${STAGING_LIBDIR}/../share/gtk-doc/html/pygobject/
-}
diff --git a/packages/qmake/qmake2-native-2.10a/use-lflags-last.patch b/packages/qmake/qmake2-native-2.10a/use-lflags-last.patch
new file mode 100644
index 0000000000..4197dbbf64
--- /dev/null
+++ b/packages/qmake/qmake2-native-2.10a/use-lflags-last.patch
@@ -0,0 +1,22 @@
+Index: qtopia-core-opensource-src-4.3.1/qmake/generators/unix/unixmake2.cpp
+===================================================================
+--- qtopia-core-opensource-src-4.3.1.orig/qmake/generators/unix/unixmake2.cpp 2007-10-07 13:45:26.000000000 +0200
++++ qtopia-core-opensource-src-4.3.1/qmake/generators/unix/unixmake2.cpp 2007-10-07 13:57:09.000000000 +0200
+@@ -416,7 +416,7 @@
+ t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
+ if(!project->isEmpty("QMAKE_PRE_LINK"))
+ t << var("QMAKE_PRE_LINK") << "\n\t";
+- t << "$(LINK) $(LFLAGS) -o $(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
++ t << "$(LINK) -o $(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS) $(LFLAGS)";
+ if(!project->isEmpty("QMAKE_POST_LINK"))
+ t << "\n\t" << var("QMAKE_POST_LINK");
+ t << endl << endl;
+@@ -430,7 +430,7 @@
+ t << mkdir_p_asstring(destdir) << "\n\t";
+ if(!project->isEmpty("QMAKE_PRE_LINK"))
+ t << var("QMAKE_PRE_LINK") << "\n\t";
+- t << "$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
++ t << "$(LINK) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) $(LFLAGS)";
+ if(!project->isEmpty("QMAKE_POST_LINK"))
+ t << "\n\t" << var("QMAKE_POST_LINK");
+ t << endl << endl;
diff --git a/packages/qmake/qmake2-native_2.10a.bb b/packages/qmake/qmake2-native_2.10a.bb
index 207aaaf9b5..55282e562c 100644
--- a/packages/qmake/qmake2-native_2.10a.bb
+++ b/packages/qmake/qmake2-native_2.10a.bb
@@ -9,6 +9,7 @@ QTVER = "qtopia-core-opensource-src-4.3.1"
SRC_URI = "ftp://ftp.trolltech.com/pub/qt/source/${QTVER}.tar.gz \
file://0001-fix-mkspecs.patch;patch=1 \
+ file://use-lflags-last.patch;patch=1 \
file://linux-oe-qmake.conf"
S = "${WORKDIR}/${QTVER}"
diff --git a/packages/rxvt-unicode/rxvt-unicode_7.9.bb b/packages/rxvt-unicode/rxvt-unicode_7.9.bb
index 72d686bffd..e08583527c 100644
--- a/packages/rxvt-unicode/rxvt-unicode_7.9.bb
+++ b/packages/rxvt-unicode/rxvt-unicode_7.9.bb
@@ -13,7 +13,7 @@ FILES_${PN}-control = "${bindir}/rxvtc"
SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2 \
file://xwc.patch;patch=1 \
file://signedchar.patch;patch=1"
-PR = "r0"
+PR = "r1"
inherit autotools update-alternatives
@@ -23,6 +23,10 @@ ALTERNATIVE_PATH = "${bindir}/rxvt"
CFLAGS_append = " -fpermissive"
+# This is necessary so that the "tic" command executed during the install can
+# link with the correct libary in staging.
+export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
+
EXTRA_OECONF = "--enable-menubar --enable-xim \
--enable-utmp --enable-wtmp --enable-lastlog \
--disable-strings --with-term=rxvt --enable-keepscrolling \
diff --git a/packages/sylpheed/claws-mail.inc b/packages/sylpheed/claws-mail.inc
deleted file mode 100644
index d8b3a2bc72..0000000000
--- a/packages/sylpheed/claws-mail.inc
+++ /dev/null
@@ -1,46 +0,0 @@
-SECTION = "x11/network"
-DESCRIPTION = "Mail user agent"
-DEPENDS = "gtk+ libetpan openssl aspell"
-LICENSE = "GPL"
-PR = "r0"
-
-SRC_URI = "\
- ${SOURCEFORGE_MIRROR}/sylpheed-claws/claws-mail-${PV}.tar.bz2 \
- file://desktop.patch;patch=1 \
- file://streamline-ui.patch;patch=1 \
- "
-
-FILES_${PN} = "${bindir} ${datadir}/pixmaps ${datadir}/applications"
-
-EXTRA_OECONF = "--disable-aspell-test \
- --enable--aspell \
- --disable-manual \
- --disable-crash-dialog \
- --disable-jpilot \
- --disable-trayicon-plugin \
- --disable-spamassassin-plugin \
- --disable-bogofilter-plugin \
- --disable-pgpcore-plugin \
- --disable-pgpmime-plugin \
- --disable-pgpinline-plugin \
- --disable-dillo-viewer-plugin \
- --disable-clamav-plugin \
- --disable-gnomeprint \
- --disable-valgrind \
- "
-
-CFLAGS += "-D_GNU_SOURCE"
-
-inherit autotools pkgconfig
-
-do_install_append() {
- install -d ${D}${datadir}/applications
- install -m 0644 claws-mail.desktop ${D}${datadir}/applications/
- install -d ${D}${datadir}/pixmaps
- install -m 0644 claws-mail.png ${D}${datadir}/pixmaps/
-}
-
-do_stage () {
- autotools_stage_all
-}
-
diff --git a/packages/sylpheed/claws-mail_2.7.2.bb b/packages/sylpheed/claws-mail_2.7.2.bb
deleted file mode 100644
index 6a698e1914..0000000000
--- a/packages/sylpheed/claws-mail_2.7.2.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-SECTION = "x11/network"
-DESCRIPTION = "Mail user agent"
-DEPENDS = "gtk+ gpgme libetpan libgnomeprint aspell openssl"
-LICENSE = "GPL"
-PR = "r0"
-
-SRC_URI = "${SOURCEFORGE_MIRROR}/sylpheed-claws/claws-mail-${PV}.tar.bz2"
-
-FILES_${PN} = "${bindir} ${datadir}/pixmaps ${datadir}/applications"
-
-EXTRA_OECONF = "--disable-aspell-test \
- --disable-dillo-viewer-plugin --with-aspell-prefix=${STAGING_DIR}/${HOST_SYS} \
- --enable-aspell"
-
-CFLAGS += "-D_GNU_SOURCE"
-
-inherit autotools pkgconfig
-
-do_configure() {
- gnu-configize
- libtoolize --force
- oe_runconf
-}
-
-do_install_append() {
- install -d ${D}${datadir}/applications
- install -m 0644 claws-mail.desktop ${D}${datadir}/applications/
- install -d ${D}${datadir}/pixmaps
- install -m 0644 claws-mail.png ${D}${datadir}/pixmaps/
- mv ${D}${bindir}/${TARGET_SYS}-claws-mail ${D}${bindir}/${PN}
-}
-
-do_stage () {
- autotools_stage_all
-}
-
-python populate_packages_prepend () {
- abiword_libdir = bb.data.expand('${libdir}/claws-mail/plugins', d)
-
- do_split_packages(d, abiword_libdir, '^(.*)\.so$', 'claws-mail-plugin-%s', 'Claws plugin for %s', extra_depends='')
-}
diff --git a/packages/sylpheed/claws-mail_2.9.1.bb b/packages/sylpheed/claws-mail_2.9.1.bb
deleted file mode 100644
index f8a8396b95..0000000000
--- a/packages/sylpheed/claws-mail_2.9.1.bb
+++ /dev/null
@@ -1 +0,0 @@
-require claws-mail.inc
diff --git a/packages/sylpheed/claws-mail_3.0.1.bb b/packages/sylpheed/claws-mail_3.0.2.bb
index 29e7a5bc63..29e7a5bc63 100644
--- a/packages/sylpheed/claws-mail_3.0.1.bb
+++ b/packages/sylpheed/claws-mail_3.0.2.bb
diff --git a/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.14.1.bb b/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.2.bb
index 5ca95d9dfb..5ca95d9dfb 100644
--- a/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.14.1.bb
+++ b/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.2.bb
diff --git a/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.bb b/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.bb
deleted file mode 100644
index 5ca95d9dfb..0000000000
--- a/packages/sylpheed/claws-plugin-gtkhtml2-viewer_0.15.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SECTION = "x11/network"
-DESCRIPTION = "Mail user agent plugins"
-DEPENDS = "claws-mail gtkhtml2 curl"
-LICENSE = "GPL"
-PR = "r0"
-
-SRC_URI = "http://www.claws-mail.org/downloads/plugins/gtkhtml2_viewer-${PV}.tar.gz"
-
-inherit autotools pkgconfig
-
-S = "${WORKDIR}/gtkhtml2_viewer-${PV}"
-
-do_configure() {
- gnu-configize
- libtoolize --force
- oe_runconf
-}
-
-FILES_${PN} = "${libdir}/claws-mail/plugins/*.so"
-
diff --git a/packages/sylpheed/claws-plugin-maildir_0.24.4.bb b/packages/sylpheed/claws-plugin-maildir_0.24.4.bb
deleted file mode 100644
index 6032e09918..0000000000
--- a/packages/sylpheed/claws-plugin-maildir_0.24.4.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SECTION = "x11/network"
-DESCRIPTION = "Mail user agent plugins"
-DEPENDS = "claws-mail db"
-LICENSE = "GPL"
-PR = "r0"
-
-SRC_URI = "http://www.claws-mail.org/downloads/plugins/maildir-${PV}.tar.gz"
-
-inherit autotools pkgconfig
-
-S = "${WORKDIR}/maildir-${PV}"
-
-do_configure() {
- gnu-configize
- libtoolize --force
- oe_runconf
-}
-
-FILES_${PN} = "${libdir}/claws-mail/plugins/*.so"
-
diff --git a/packages/sylpheed/claws-plugin-mailmbox_1.12.4.bb b/packages/sylpheed/claws-plugin-mailmbox_1.12.4.bb
deleted file mode 100644
index d1f9e22d22..0000000000
--- a/packages/sylpheed/claws-plugin-mailmbox_1.12.4.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SECTION = "x11/network"
-DESCRIPTION = "Mail user agent plugins"
-DEPENDS = "claws-mail"
-LICENSE = "GPL"
-PR = "r0"
-
-SRC_URI = "http://www.claws-mail.org/downloads/plugins/mailmbox-${PV}.tar.gz"
-
-inherit autotools pkgconfig
-
-S = "${WORKDIR}/mailmbox-${PV}"
-
-do_configure() {
- gnu-configize
- libtoolize --force
- oe_runconf
-}
-
-FILES_${PN} = "${libdir}/claws-mail/plugins/*.so"
-
diff --git a/packages/sylpheed/claws-plugin-mailmbox_1.13.bb b/packages/sylpheed/claws-plugin-mailmbox_1.14.bb
index 03e939ead3..03e939ead3 100644
--- a/packages/sylpheed/claws-plugin-mailmbox_1.13.bb
+++ b/packages/sylpheed/claws-plugin-mailmbox_1.14.bb
diff --git a/packages/sylpheed/claws-plugin-rssyl_0.13.bb b/packages/sylpheed/claws-plugin-rssyl_0.15.bb
index 29fc245ac4..29fc245ac4 100644
--- a/packages/sylpheed/claws-plugin-rssyl_0.13.bb
+++ b/packages/sylpheed/claws-plugin-rssyl_0.15.bb
diff --git a/packages/tasks/task-base.bb b/packages/tasks/task-base.bb
index 14d06e8926..ea22e0531e 100644
--- a/packages/tasks/task-base.bb
+++ b/packages/tasks/task-base.bb
@@ -98,6 +98,8 @@ RDEPENDS_task-base = "\
${@base_contains('COMBINED_FEATURES', 'redboot', 'task-base-redboot', '',d)} \
\
${@base_contains('DISTRO_FEATURES', 'nfs', 'task-base-nfs', '',d)} \
+ ${@base_contains('DISTRO_FEATURES', 'cramfs', 'task-base-cramfs', '',d)} \
+ ${@base_contains('DISTRO_FEATURES', 'smbfs', 'task-base-smbfs', '',d)} \
${@base_contains('DISTRO_FEATURES', 'ipv6', 'task-base-ipv6', '',d)} \
${@base_contains('DISTRO_FEATURES', 'ipsec', 'task-base-ipsec', '',d)} \
${@base_contains('DISTRO_FEATURES', 'ppp', 'task-base-ppp', '',d)} \
diff --git a/packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty b/packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/tslib/tslib-1.0/bd-neon/.mtn2git_empty
diff --git a/packages/tslib/tslib-1.0/bd-neon/ts.conf b/packages/tslib/tslib-1.0/bd-neon/ts.conf
new file mode 100644
index 0000000000..15fe294ce6
--- /dev/null
+++ b/packages/tslib/tslib-1.0/bd-neon/ts.conf
@@ -0,0 +1,5 @@
+module_raw ucb1x00
+module pthres pmin=1
+module variance delta=500
+module dejitter delta=10000
+module linear
diff --git a/packages/tslib/tslib-1.0/bd-neon/tslib.sh b/packages/tslib/tslib-1.0/bd-neon/tslib.sh
new file mode 100644
index 0000000000..b5f1c906f3
--- /dev/null
+++ b/packages/tslib/tslib-1.0/bd-neon/tslib.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+TSLIB_TSDEVICE=/dev/touch_ucb1x00
+
+export TSLIB_TSDEVICE
+
diff --git a/packages/tslib/tslib_1.0.bb b/packages/tslib/tslib_1.0.bb
index 51bd1f6a7b..598e60fe4d 100644
--- a/packages/tslib/tslib_1.0.bb
+++ b/packages/tslib/tslib_1.0.bb
@@ -4,7 +4,7 @@ AUTHOR = "Russell King w/ plugins by Chris Larson et. al."
SECTION = "base"
LICENSE = "LGPL"
-PR = "r16"
+PR = "r17"
SRC_URI = "http://download.berlios.de/tslib/tslib-1.0.tar.bz2 \
file://tslib-input_raw-grab_events.patch;patch=1 \
diff --git a/packages/uboot/u-boot-1.1.2/u-boot-1.1.2-neon.patch b/packages/uboot/u-boot-1.1.2/u-boot-1.1.2-neon.patch
new file mode 100644
index 0000000000..ed959d43d8
--- /dev/null
+++ b/packages/uboot/u-boot-1.1.2/u-boot-1.1.2-neon.patch
@@ -0,0 +1,19204 @@
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/bd2003.c u-boot-1.1.2-neon/board/bd2003/bd2003.c
+--- u-boot-1.1.2/board/bd2003/bd2003.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/bd2003.c 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,94 @@
++/*
++ * (C) Copyright 2002
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2002
++ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
++ * Marius Groeger <mgroeger@sysgo.de>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <config.h>
++#include <common.h>
++#include <version.h>
++#include <stdarg.h>
++#include <linux/types.h>
++#include <devices.h>
++#include <lcd.h>
++#include <lcd_panels.h>
++
++/* ------------------------------------------------------------------------- */
++/*
++ * LCD panel declarations
++ */
++
++vidinfo_t panel_info = {
++ vl_col: 1024, //this is corrected in SetPanelInfo
++ vl_row: 768,
++ vl_bpix: LCD_BPP,
++ vl_lcd_line_length: (320 * NBITS(LCD_BPP) ) >> 3
++};
++
++void disable_lcd_panel( void )
++{
++}
++
++
++/* ------------------------------------------------------------------------- */
++
++
++/*
++ * Miscelaneous platform dependent initialisations
++ */
++
++int board_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ /* memory and cpu-speed are setup before relocation */
++ /* so we do _nothing_ here */
++
++ /* arch number of Neon Board */
++ gd->bd->bi_arch_number = MACH_TYPE_BD2003 ;
++
++ /* adress of boot parameters */
++ gd->bd->bi_boot_params = 0xa0000100;
++
++ return 0;
++}
++
++int board_late_init(void)
++{
++ setenv("stdout", "serial");
++ setenv("stderr", "serial");
++ return 0;
++}
++
++
++int dram_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
++ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
++
++ return 0;
++}
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/config.mk u-boot-1.1.2-neon/board/bd2003/config.mk
+--- u-boot-1.1.2/board/bd2003/config.mk 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/config.mk 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,4 @@
++#TEXT_BASE = 0xa1700000
++TEXT_BASE = 0xA1F00000
++#TEXT_BASE = 0
++PXALCD = 1
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/.cvsignore u-boot-1.1.2-neon/board/bd2003/.cvsignore
+--- u-boot-1.1.2/board/bd2003/.cvsignore 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/.cvsignore 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,2 @@
++.depend
++
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/flash.c u-boot-1.1.2-neon/board/bd2003/flash.c
+--- u-boot-1.1.2/board/bd2003/flash.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/flash.c 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,477 @@
++/*
++ * (C) Copyright 2001
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2001
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <linux/byteorder/swab.h>
++#include <asm/arch/pxa250Base.h>
++#include <asm/arch/pxaHardware.h>
++#include "lcd.h"
++
++flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
++
++/* Board support for 1 or 2 flash devices */
++#define FLASH_PORT_WIDTH32
++#undef FLASH_PORT_WIDTH16
++
++#ifdef FLASH_PORT_WIDTH16
++#define FLASH_PORT_WIDTH ushort
++#define FLASH_PORT_WIDTHV vu_short
++#define SWAP(x) __swab16(x)
++#else
++#define FLASH_PORT_WIDTH ulong
++#define FLASH_PORT_WIDTHV vu_long
++#define SWAP(x) __swab32(x)
++#endif
++
++#define FPW FLASH_PORT_WIDTH
++#define FPWV FLASH_PORT_WIDTHV
++
++#define mb() __asm__ __volatile__ ("" : : : "memory")
++
++/*-----------------------------------------------------------------------
++ * Functions
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info);
++static int write_data (flash_info_t *info, ulong dest, FPW data);
++static void flash_get_offsets (ulong base, flash_info_t *info);
++void inline spin_wheel_init(ulong addr, ulong cnt);
++void inline spin_wheel_done( int worked );
++void inline spin_wheel (ulong numleft);
++
++/*-----------------------------------------------------------------------
++ */
++ulong bases[] = {PHYS_FLASH_1,PHYS_FLASH_2,1};
++unsigned long flash_init (void)
++{
++ int i=0;
++ int j=0;
++ ulong size = 0;
++ ulong base;
++
++ while (i < CFG_MAX_FLASH_BANKS) {
++ base = bases[j++];
++ flash_info[i].start[0] = 0;
++ if (base & 1) break;
++ if (flash_get_size ((FPW *) base, &flash_info[i])) {
++ flash_get_offsets (base, &flash_info[i]);
++ size += flash_info[i].size;
++ i++;
++ }
++ else {
++printf( "error reading flash size\n" );
++ }
++ }
++ if (size>0) {
++ base = flash_info[0].start[0];
++ // Protect monitor and environment sectors
++ flash_protect ( FLAG_PROTECT_SET,
++ base,
++ base + monitor_flash_len - 1,
++ &flash_info[0] );
++
++ flash_protect ( FLAG_PROTECT_SET,
++ base+CFG_ENV_OFFSET,
++ base+CFG_ENV_OFFSET + CFG_ENV_SIZE - 1, &flash_info[0] );
++ }
++
++ return size;
++}
++
++/*-----------------------------------------------------------------------
++ */
++static void flash_get_offsets (ulong base, flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return;
++ }
++
++ if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
++ for (i = 0; i < info->sector_count; i++) {
++ info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
++ info->protect[i] = 0;
++ }
++ }
++}
++
++/*-----------------------------------------------------------------------
++ */
++void flash_print_info (flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("missing or unknown FLASH type\n");
++ return;
++ }
++
++ switch (info->flash_id & FLASH_VENDMASK) {
++ case FLASH_MAN_INTEL:
++ printf ("INTEL ");
++ break;
++ default:
++ printf ("Unknown Vendor ");
++ break;
++ }
++
++ switch (info->flash_id & FLASH_TYPEMASK) {
++ case FLASH_28F128J3A:
++ printf ("28F128J3A\n");
++ break;
++ default:
++ printf ("Unknown Chip Type\n");
++ break;
++ }
++
++ printf (" Size: %ld MB in %d Sectors\n",
++ info->size >> 20, info->sector_count);
++
++ printf (" Sector Start Addresses:");
++ for (i = 0; i < info->sector_count; ++i) {
++ if ((i % 5) == 0)
++ printf ("\n ");
++ printf (" %08lX%s",
++ info->start[i],
++ info->protect[i] ? " (RO)" : " ");
++ }
++ printf ("\n");
++ return;
++}
++
++/*
++ * The following code cannot be run from FLASH!
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info)
++{
++ volatile FPW value;
++ volatile unsigned long *mc = (unsigned long *)MEMORY_CONTROL_BASE;
++ unsigned long val = 1<<3;
++
++ info->flash_id = FLASH_UNKNOWN;
++ info->sector_count = 0;
++ info->size = 0;
++
++ if (((ulong)addr) > 0x14000000) return 0;
++ val = mc[(MSC0>>2) +(((ulong)addr)>>27)];
++ if (((ulong)addr) & 0x04000000) val = val>>16;
++ if ( val & (1<<3)) return 0; //if 16 bit bus then return
++
++ /* Write auto select command: read Manufacturer ID */
++ addr[0x5555] = (FPW) 0x00AA00AA;
++ addr[0x2AAA] = (FPW) 0x00550055;
++ addr[0x5555] = (FPW) 0x00900090;
++
++ mb ();
++ value = addr[0];
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) INTEL_MANUFACT & 0xFF0000 :
++ case (FPW) INTEL_MANUFACT & 0x0000FF :
++ case (FPW) INTEL_MANUFACT:
++ info->flash_id = FLASH_MAN_INTEL;
++ break;
++
++ default:
++printf( "Invalid flash manufacturer %x\n", value );
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++ return (0); /* no or unknown flash */
++ }
++
++ mb ();
++ value = addr[1]; /* device ID */
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) INTEL_ID_28F128J3A & 0xFF0000 :
++ case (FPW) INTEL_ID_28F128J3A & 0x0000FF :
++ case (FPW) INTEL_ID_28F128J3A:
++ info->flash_id += FLASH_28F128J3A;
++ info->sector_count = 128;
++ info->size = 0x02000000;
++ break; /* => 16 MB */
++
++ default:
++printf( "Unknown flash device %x\n", value );
++ info->flash_id = FLASH_UNKNOWN;
++ break;
++ }
++
++ if (info->sector_count > CFG_MAX_FLASH_SECT) {
++ printf ("** ERROR: sector count %d > max (%d) **\n",
++ info->sector_count, CFG_MAX_FLASH_SECT);
++ info->sector_count = CFG_MAX_FLASH_SECT;
++ }
++
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++
++ return (info->size);
++}
++
++
++/*-----------------------------------------------------------------------
++ */
++
++int flash_erase (flash_info_t *info, int s_first, int s_last)
++{
++ int flag, prot, sect;
++ ulong type, start, last;
++ int rcode = 0;
++
++ if ((s_first < 0) || (s_first > s_last)) {
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("- missing\n");
++ } else {
++ printf ("- no sectors to erase\n");
++ }
++ return 1;
++ }
++
++ type = (info->flash_id & FLASH_VENDMASK);
++ if ((type != FLASH_MAN_INTEL)) {
++ printf ("Can't erase unknown flash type %08lx - aborted\n",
++ info->flash_id);
++ return 1;
++ }
++
++ prot = 0;
++ for (sect = s_first; sect <= s_last; ++sect) {
++ if (info->protect[sect]) {
++ prot++;
++ }
++ }
++
++ if (prot) {
++ printf ("- Warning: %d protected sectors will not be erased!\n",
++ prot);
++ } else {
++ printf ("\n");
++ }
++
++ start = get_timer (0);
++ last = start;
++
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ /* Start erase on unprotected sectors */
++ for (sect = s_first; sect <= s_last; sect++) {
++ if (info->protect[sect] == 0) { /* not protected */
++ char temp[80];
++ FPWV *addr = (FPWV *) (info->start[sect]);
++ FPW status;
++
++ sprintf (temp, "Erasing sector %2d ... \r", sect);
++ lcd_puts( temp );
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ *addr = (FPW) 0x00500050; /* clear status register */
++ *addr = (FPW) 0x00200020; /* erase setup */
++ *addr = (FPW) 0x00D000D0; /* erase confirm */
++
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
++ printf ("Timeout\n");
++ *addr = (FPW) 0x00B000B0; /* suspend erase */
++ *addr = (FPW) 0x00FF00FF; /* reset to read mode */
++ rcode = 1;
++ break;
++ }
++ }
++
++ *addr = 0x00500050; /* clear status register cmd. */
++ *addr = 0x00FF00FF; /* resest to read mode */
++ }
++ }
++ lcd_puts( "\r\n" );
++ return rcode;
++}
++
++/*-----------------------------------------------------------------------
++ * Copy memory to flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ * 4 - Flash not identified
++ */
++
++int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
++{
++ ulong cp, wp;
++ FPW data;
++ int count, i, l, rc, port_width;
++
++ rc = 0 ;
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return 4;
++ }
++/* get lower word aligned address */
++#ifdef FLASH_PORT_WIDTH16
++ wp = (addr & ~1);
++ port_width = 2;
++#else
++ wp = (addr & ~3);
++ port_width = 4;
++#endif
++
++ spin_wheel_init(addr,cnt);
++
++ /*
++ * handle unaligned start bytes
++ */
++ if ((l = addr - wp) != 0) {
++ data = 0;
++ for (i = 0, cp = wp; i < l; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++ for (; i < port_width && cnt > 0; ++i) {
++ data = (data << 8) | *src++;
++ --cnt;
++ ++cp;
++ }
++ for (; cnt == 0 && i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ }
++
++ /*
++ * handle word aligned part
++ */
++ count = 0;
++ while (cnt >= port_width) {
++ data = 0;
++ for (i = 0; i < port_width; ++i) {
++ data = (data << 8) | *src++;
++ }
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ cnt -= port_width;
++ if (count++ > 0x800) {
++ spin_wheel (cnt);
++ count = 0;
++ }
++ }
++
++ if (cnt) {
++ /*
++ * handle unaligned tail bytes
++ */
++ data = 0;
++ for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
++ data = (data << 8) | *src++;
++ --cnt;
++ }
++ for (; i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ rc = write_data (info, wp, SWAP (data));
++ }
++
++out:
++ spin_wheel_done(0 == rc);
++ return rc ;
++}
++
++/*-----------------------------------------------------------------------
++ * Write a word or halfword to Flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ */
++static int write_data (flash_info_t *info, ulong dest, FPW data)
++{
++ FPWV *addr = (FPWV *) dest;
++ FPW old = *addr ;
++ ulong status;
++ int flag;
++
++ /* Check if Flash is (sufficiently) erased */
++ if ((old & data) != data) {
++ printf ("not erased at %08lx (%lx)\n", (ulong) addr, old);
++ return (2);
++ }
++
++ if( old != data )
++ {
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ *addr = (FPW) 0x00400040; /* write setup */
++ *addr = data;
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ /* wait while polling the status register */
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ return (1);
++ }
++ }
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ } /* need to program? */
++
++
++ return (0);
++}
++
++void inline spin_wheel_init(ulong addr, ulong cnt)
++{
++ char temp[80];
++ sprintf( temp,
++ "\nprogramming flash\n"
++ "%08lx->%08lx\n"
++ " ", addr, cnt );
++ lcd_puts( temp );
++}
++
++void inline spin_wheel_done( int worked )
++{
++ if( worked )
++ spin_wheel(0);
++ lcd_puts( worked ? "\ncompleted.\n" : "\nfailed!\n" );
++}
++
++void inline spin_wheel( ulong numleft )
++{
++ char temp[40];
++ sprintf( temp, "\r %08lx", numleft );
++ lcd_puts( temp );
++}
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/init.script u-boot-1.1.2-neon/board/bd2003/init.script
+--- u-boot-1.1.2/board/bd2003/init.script 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/init.script 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,42 @@
++if fatload mmc 0 a0000000 logo.bmp ; then
++ bmp info a0000000 ;
++ bmp display a0000000 ;
++else
++ lecho "No logo present" ;
++fi
++
++if fatload mmc 0 a2000000 uimage ; then
++ lecho 'load Linux'
++ if fatload mmc 0 a2200000 mmcinitrd.u-boot ; then
++ echo 'using initrd' ;
++ lecho "Booting Linux"
++ set bootargs root=/dev/ram0 console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1)
++ bootm a2000000 a2200000
++ else
++ echo 'testing cramfs img' ;
++ if fatload mmc 0 a2200000 cramfs.img ; then
++ if cmp.b 00140000 a2200000 $filesize ; then
++ echo 'cramfs images match' ;
++ else
++ lecho 'filesystems differ...' ;
++ protect off all ;
++ erase 00140000 01ffffff ;
++ cp.b a2200000 00140000 $filesize ;
++ fi
++
++ set bootargs console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs
++ lecho "Booting Linux"
++ bootm a2000000
++ fi
++ fi
++else
++ echo "No Linux kernel" ;
++fi
++
++lecho 'No Linux, try CE'
++
++if fatload mmc 0 A0030000 nk.nb0 ; then
++ g A0030000 ;
++else
++ echo "No WinCE image" ;
++fi
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/Makefile u-boot-1.1.2-neon/board/bd2003/Makefile
+--- u-boot-1.1.2/board/bd2003/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/Makefile 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,48 @@
++
++#
++# (C) Copyright 2000
++# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++#
++# See file CREDITS for list of people who contributed to this
++# project.
++#
++# 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
++#
++
++include $(TOPDIR)/config.mk
++
++LIB = lib$(BOARD).a
++
++OBJS := bd2003.o flash.o
++SOBJS := memsetup.o
++
++$(LIB): $(OBJS) $(SOBJS)
++ $(AR) crv $@ $(OBJS) $(SOBJS)
++
++clean:
++ rm -f $(SOBJS) $(OBJS)
++
++distclean: clean
++ rm -f $(LIB) core *.bak .depend
++
++#########################################################################
++
++.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
++ $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
++
++-include .depend
++
++#########################################################################
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/memsetup.S u-boot-1.1.2-neon/board/bd2003/memsetup.S
+--- u-boot-1.1.2/board/bd2003/memsetup.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/memsetup.S 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,64 @@
++/*
++ * Most of this taken from Redboot hal_platform_setup.h with cleanup
++ *
++ * NOTE: I haven't clean this up considerably, just enough to get it
++ * running. See hal_platform_setup.h for the source. See
++ * board/cradle/memsetup.S for another PXA250 setup that is
++ * much cleaner.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <config.h>
++#include <version.h>
++
++#define BAUDRATE 115200
++#include <asm/arch/platformTypes.h>
++#include <configs/select.h>
++#include <asm/arch/pxaGpio.h>
++#include <asm/arch/pxaMacro3.h>
++
++DRAM_SIZE: .long CFG_DRAM_SIZE
++
++/* wait for coprocessor write complete */
++ .macro CPWAIT reg
++ mrc p15,0,\reg,c2,c0,0
++ mov \reg,\reg
++ sub pc,pc,#4
++ .endm
++
++
++/*
++ * Memory setup
++ */
++
++.globl memsetup
++memsetup:
++
++ mov r10, lr
++
++ InitCS0_CS1 r0,sp
++ InitGPIO r0,sp
++ InitIC_Clocks r0,sp
++ InitUART r0,sp,UART_BASE,BAUDRATE
++ InitUART r0,sp,UART_BASE+0x600000,9600
++ InitChangeCPUSpeed r0
++ InitMemory r0,sp,r1
++
++ mov pc, lr
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/u-boot.lds u-boot-1.1.2-neon/board/bd2003/u-boot.lds
+--- u-boot-1.1.2/board/bd2003/u-boot.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/u-boot.lds 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(_start)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/start.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/board/bd2003/u-bootmini.lds u-boot-1.1.2-neon/board/bd2003/u-bootmini.lds
+--- u-boot-1.1.2/board/bd2003/u-bootmini.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/bd2003/u-bootmini.lds 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(StartUp)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/minidebug.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/board/halogen/config.mk u-boot-1.1.2-neon/board/halogen/config.mk
+--- u-boot-1.1.2/board/halogen/config.mk 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/config.mk 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,4 @@
++#TEXT_BASE = 0xa1700000
++TEXT_BASE = 0xA1F00000
++#TEXT_BASE = 0
++PXALCD = 1
+diff -u -r --new-file u-boot-1.1.2/board/halogen/.cvsignore u-boot-1.1.2-neon/board/halogen/.cvsignore
+--- u-boot-1.1.2/board/halogen/.cvsignore 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/.cvsignore 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,2 @@
++.depend
++
+diff -u -r --new-file u-boot-1.1.2/board/halogen/flash.c u-boot-1.1.2-neon/board/halogen/flash.c
+--- u-boot-1.1.2/board/halogen/flash.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/flash.c 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,482 @@
++/*
++ * (C) Copyright 2001
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2001
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <linux/byteorder/swab.h>
++#include <asm/arch/pxa250Base.h>
++#include <asm/arch/pxaHardware.h>
++#include "lcd.h"
++
++flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
++
++/* Board support for 1 or 2 flash devices */
++#define FLASH_PORT_WIDTH32
++#undef FLASH_PORT_WIDTH16
++
++#ifdef FLASH_PORT_WIDTH16
++#define FLASH_PORT_WIDTH ushort
++#define FLASH_PORT_WIDTHV vu_short
++#define SWAP(x) __swab16(x)
++#else
++#define FLASH_PORT_WIDTH ulong
++#define FLASH_PORT_WIDTHV vu_long
++#define SWAP(x) __swab32(x)
++#endif
++
++#define FPW FLASH_PORT_WIDTH
++#define FPWV FLASH_PORT_WIDTHV
++
++#define mb() __asm__ __volatile__ ("" : : : "memory")
++
++/*-----------------------------------------------------------------------
++ * Functions
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info);
++static int write_data (flash_info_t *info, ulong dest, FPW data);
++static void flash_get_offsets (ulong base, flash_info_t *info);
++void inline spin_wheel_init(ulong addr, ulong cnt);
++void inline spin_wheel_done( int worked );
++void inline spin_wheel (ulong numleft);
++
++/*-----------------------------------------------------------------------
++ */
++ulong bases[] = {PHYS_FLASH_1,PHYS_FLASH_2,1};
++unsigned long flash_init (void)
++{
++ int i=0;
++ int j=0;
++ ulong size = 0;
++ ulong base;
++
++ while (i < CFG_MAX_FLASH_BANKS) {
++ base = bases[j++];
++ flash_info[i].start[0] = 0;
++ if (base & 1) break;
++ if (flash_get_size ((FPW *) base, &flash_info[i])) {
++ flash_get_offsets (base, &flash_info[i]);
++ size += flash_info[i].size;
++ i++;
++ }
++ else {
++printf( "error reading flash size\n" );
++ }
++ }
++ if (size>0) {
++ base = flash_info[0].start[0];
++ // Protect monitor and environment sectors
++ flash_protect ( FLAG_PROTECT_SET,
++ base,
++ base + monitor_flash_len - 1,
++ &flash_info[0] );
++
++ flash_protect ( FLAG_PROTECT_SET,
++ base+CFG_ENV_OFFSET,
++ base+CFG_ENV_OFFSET + CFG_ENV_SIZE - 1, &flash_info[0] );
++ }
++
++ return size;
++}
++
++/*-----------------------------------------------------------------------
++ */
++static void flash_get_offsets (ulong base, flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return;
++ }
++
++ if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
++ for (i = 0; i < info->sector_count; i++) {
++ info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
++ info->protect[i] = 0;
++ }
++ }
++}
++
++/*-----------------------------------------------------------------------
++ */
++void flash_print_info (flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("missing or unknown FLASH type\n");
++ return;
++ }
++
++ switch (info->flash_id & FLASH_VENDMASK) {
++ case FLASH_MAN_INTEL:
++ printf ("INTEL ");
++ break;
++ default:
++ printf ("Unknown Vendor ");
++ break;
++ }
++
++ switch (info->flash_id & FLASH_TYPEMASK) {
++ case FLASH_28F128J3A:
++ printf ("28F128J3A\n");
++ break;
++ default:
++ printf ("Unknown Chip Type\n");
++ break;
++ }
++
++ printf (" Size: %ld MB in %d Sectors\n",
++ info->size >> 20, info->sector_count);
++
++ printf (" Sector Start Addresses:");
++ for (i = 0; i < info->sector_count; ++i) {
++ if ((i % 5) == 0)
++ printf ("\n ");
++ printf (" %08lX%s",
++ info->start[i],
++ info->protect[i] ? " (RO)" : " ");
++ }
++ printf ("\n");
++ return;
++}
++
++/*
++ * The following code cannot be run from FLASH!
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info)
++{
++ volatile FPW value;
++ volatile unsigned long *mc = (unsigned long *)MEMORY_CONTROL_BASE;
++ unsigned long val = 1<<3;
++
++ info->flash_id = FLASH_UNKNOWN;
++ info->sector_count = 0;
++ info->size = 0;
++
++ if (((ulong)addr) > 0x14000000) return 0;
++ val = mc[(MSC0>>2) +(((ulong)addr)>>27)];
++ if (((ulong)addr) & 0x04000000) val = val>>16;
++ if ( val & (1<<3)) return 0; //if 16 bit bus then return
++
++ /* Write auto select command: read Manufacturer ID */
++ addr[0x5555] = (FPW) 0x00AA00AA;
++ addr[0x2AAA] = (FPW) 0x00550055;
++ addr[0x5555] = (FPW) 0x00900090;
++
++ mb ();
++ value = addr[0];
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) STM_MANUFACT:
++ case (FPW) INTEL_MANUFACT & 0xFF0000 :
++ case (FPW) INTEL_MANUFACT & 0x0000FF :
++ case (FPW) INTEL_MANUFACT:
++ info->flash_id = FLASH_MAN_INTEL;
++ break;
++
++ default:
++printf( "Invalid flash manufacturer %x\n", value );
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++ return (0); /* no or unknown flash */
++ }
++
++ mb ();
++ value = addr[1]; /* device ID */
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) INTEL_ID_28F128J3A & 0xFF0000 :
++ case (FPW) INTEL_ID_28F128J3A & 0x0000FF :
++ case (FPW) INTEL_ID_28F128J3A:
++ info->flash_id += FLASH_28F128J3A;
++ info->sector_count = 128;
++ info->size = 0x01000000;
++ break; /* => 16 MB x 1 */
++ case (FPW) INTEL_ID_28F320J3A:
++ info->flash_id += FLASH_28F320J3A;
++ info->sector_count = 32 ;
++ info->size = 0x400000 ;
++ break; /* => 4 MB x 1 */
++ default:
++printf( "Unknown flash device %x\n", value );
++ info->flash_id = FLASH_UNKNOWN;
++ break;
++ }
++
++ if (info->sector_count > CFG_MAX_FLASH_SECT) {
++ printf ("** ERROR: sector count %d > max (%d) **\n",
++ info->sector_count, CFG_MAX_FLASH_SECT);
++ info->sector_count = CFG_MAX_FLASH_SECT;
++ }
++
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++
++ return (info->size);
++}
++
++
++/*-----------------------------------------------------------------------
++ */
++
++int flash_erase (flash_info_t *info, int s_first, int s_last)
++{
++ int flag, prot, sect;
++ ulong type, start, last;
++ int rcode = 0;
++
++ if ((s_first < 0) || (s_first > s_last)) {
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("- missing\n");
++ } else {
++ printf ("- no sectors to erase\n");
++ }
++ return 1;
++ }
++
++ type = (info->flash_id & FLASH_VENDMASK);
++ if ((type != FLASH_MAN_INTEL)) {
++ printf ("Can't erase unknown flash type %08lx - aborted\n",
++ info->flash_id);
++ return 1;
++ }
++
++ prot = 0;
++ for (sect = s_first; sect <= s_last; ++sect) {
++ if (info->protect[sect]) {
++ prot++;
++ }
++ }
++
++ if (prot) {
++ printf ("- Warning: %d protected sectors will not be erased!\n",
++ prot);
++ } else {
++ printf ("\n");
++ }
++
++ start = get_timer (0);
++ last = start;
++
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ /* Start erase on unprotected sectors */
++ for (sect = s_first; sect <= s_last; sect++) {
++ if (info->protect[sect] == 0) { /* not protected */
++ char temp[80];
++ FPWV *addr = (FPWV *) (info->start[sect]);
++ FPW status;
++
++ sprintf (temp, "Erasing sector %2d ... \r", sect);
++ lcd_puts( temp );
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ *addr = (FPW) 0x00500050; /* clear status register */
++ *addr = (FPW) 0x00200020; /* erase setup */
++ *addr = (FPW) 0x00D000D0; /* erase confirm */
++
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
++ printf ("Timeout\n");
++ *addr = (FPW) 0x00B000B0; /* suspend erase */
++ *addr = (FPW) 0x00FF00FF; /* reset to read mode */
++ rcode = 1;
++ break;
++ }
++ }
++
++ *addr = 0x00500050; /* clear status register cmd. */
++ *addr = 0x00FF00FF; /* resest to read mode */
++ }
++ }
++ lcd_puts( "\r\n" );
++ return rcode;
++}
++
++/*-----------------------------------------------------------------------
++ * Copy memory to flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ * 4 - Flash not identified
++ */
++
++int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
++{
++ ulong cp, wp;
++ FPW data;
++ int count, i, l, rc, port_width;
++
++ rc = 0 ;
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return 4;
++ }
++/* get lower word aligned address */
++#ifdef FLASH_PORT_WIDTH16
++ wp = (addr & ~1);
++ port_width = 2;
++#else
++ wp = (addr & ~3);
++ port_width = 4;
++#endif
++
++ spin_wheel_init(addr,cnt);
++
++ /*
++ * handle unaligned start bytes
++ */
++ if ((l = addr - wp) != 0) {
++ data = 0;
++ for (i = 0, cp = wp; i < l; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++ for (; i < port_width && cnt > 0; ++i) {
++ data = (data << 8) | *src++;
++ --cnt;
++ ++cp;
++ }
++ for (; cnt == 0 && i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ }
++
++ /*
++ * handle word aligned part
++ */
++ count = 0;
++ while (cnt >= port_width) {
++ data = 0;
++ for (i = 0; i < port_width; ++i) {
++ data = (data << 8) | *src++;
++ }
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ cnt -= port_width;
++ if (count++ > 0x800) {
++ spin_wheel (cnt);
++ count = 0;
++ }
++ }
++
++ if (cnt) {
++ /*
++ * handle unaligned tail bytes
++ */
++ data = 0;
++ for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
++ data = (data << 8) | *src++;
++ --cnt;
++ }
++ for (; i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ rc = write_data (info, wp, SWAP (data));
++ }
++
++out:
++ spin_wheel_done(0 == rc);
++ return rc ;
++}
++
++/*-----------------------------------------------------------------------
++ * Write a word or halfword to Flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ */
++static int write_data (flash_info_t *info, ulong dest, FPW data)
++{
++ FPWV *addr = (FPWV *) dest;
++ FPW old = *addr ;
++ ulong status;
++ int flag;
++
++ /* Check if Flash is (sufficiently) erased */
++ if ((old & data) != data) {
++ printf ("not erased at %08lx (%lx)\n", (ulong) addr, old);
++ return (2);
++ }
++
++ if( old != data )
++ {
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ *addr = (FPW) 0x00400040; /* write setup */
++ *addr = data;
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ /* wait while polling the status register */
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ return (1);
++ }
++ }
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ } /* need to program? */
++
++
++ return (0);
++}
++
++void inline spin_wheel_init(ulong addr, ulong cnt)
++{
++ char temp[80];
++ sprintf( temp,
++ "\nprogramming flash\n"
++ "%08lx->%08lx\n"
++ " ", addr, cnt );
++ lcd_puts( temp );
++}
++
++void inline spin_wheel_done( int worked )
++{
++ if( worked )
++ spin_wheel(0);
++ lcd_puts( worked ? "\ncompleted.\n" : "\nfailed!\n" );
++}
++
++void inline spin_wheel( ulong numleft )
++{
++ char temp[40];
++ sprintf( temp, "\r %08lx", numleft );
++ lcd_puts( temp );
++}
+diff -u -r --new-file u-boot-1.1.2/board/halogen/halogen.c u-boot-1.1.2-neon/board/halogen/halogen.c
+--- u-boot-1.1.2/board/halogen/halogen.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/halogen.c 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,94 @@
++/*
++ * (C) Copyright 2002
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2002
++ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
++ * Marius Groeger <mgroeger@sysgo.de>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <config.h>
++#include <common.h>
++#include <version.h>
++#include <stdarg.h>
++#include <linux/types.h>
++#include <devices.h>
++#include <lcd.h>
++#include <lcd_panels.h>
++
++/* ------------------------------------------------------------------------- */
++/*
++ * LCD panel declarations
++ */
++
++vidinfo_t panel_info = {
++ vl_col: 1024, //this is corrected in SetPanelInfo
++ vl_row: 768,
++ vl_bpix: LCD_BPP,
++ vl_lcd_line_length: (320 * NBITS(LCD_BPP) ) >> 3
++};
++
++void disable_lcd_panel( void )
++{
++}
++
++
++/* ------------------------------------------------------------------------- */
++
++
++/*
++ * Miscelaneous platform dependent initialisations
++ */
++
++int board_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ /* memory and cpu-speed are setup before relocation */
++ /* so we do _nothing_ here */
++
++ /* arch number of Neon Board */
++ gd->bd->bi_arch_number = MACH_TYPE_HALOGEN ;
++
++ /* adress of boot parameters */
++ gd->bd->bi_boot_params = 0xa0000100;
++
++ return 0;
++}
++
++int board_late_init(void)
++{
++ setenv("stdout", "serial");
++ setenv("stderr", "serial");
++ return 0;
++}
++
++
++int dram_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
++ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
++
++ return 0;
++}
+diff -u -r --new-file u-boot-1.1.2/board/halogen/init.script u-boot-1.1.2-neon/board/halogen/init.script
+--- u-boot-1.1.2/board/halogen/init.script 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/init.script 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,42 @@
++if fatload mmc 0 a0008000 logo*.bmp ; then
++ bmp info a0008000 ;
++ bmp display a0008000 ;
++else
++ lecho "No logo present" ;
++fi
++
++if fatload mmc 0 a2000000 uim* ; then
++ lecho 'load Linux'
++ if fatload mmc 0 a2200000 mmcinitrd* ; then
++ echo 'using initrd' ;
++ lecho "Booting Linux"
++ set bootargs root=/dev/ram0 console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1)
++ bootm a2000000 a2200000
++ else
++ echo 'testing cramfs img' ;
++ if fatload mmc 0 a2200000 cramfs* ; then
++ if cmp.b 00140000 a2200000 $filesize ; then
++ echo 'cramfs images match' ;
++ else
++ lecho 'filesystems differ...' ;
++ protect off all ;
++ erase 00140000 01ffffff ;
++ cp.b a2200000 00140000 $filesize ;
++ fi
++
++ set bootargs console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs
++ lecho "Booting Linux"
++ bootm a2000000
++ fi
++ fi
++else
++ echo "No Linux kernel" ;
++fi
++
++lecho 'No Linux, try CE'
++
++if fatload mmc 0 A0030000 nk*.nb0 ; then
++ g A0030000 ;
++else
++ echo "No WinCE image" ;
++fi
+diff -u -r --new-file u-boot-1.1.2/board/halogen/Makefile u-boot-1.1.2-neon/board/halogen/Makefile
+--- u-boot-1.1.2/board/halogen/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/Makefile 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,48 @@
++
++#
++# (C) Copyright 2000
++# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++#
++# See file CREDITS for list of people who contributed to this
++# project.
++#
++# 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
++#
++
++include $(TOPDIR)/config.mk
++
++LIB = lib$(BOARD).a
++
++OBJS := halogen.o flash.o
++SOBJS := memsetup.o
++
++$(LIB): $(OBJS) $(SOBJS)
++ $(AR) crv $@ $(OBJS) $(SOBJS)
++
++clean:
++ rm -f $(SOBJS) $(OBJS)
++
++distclean: clean
++ rm -f $(LIB) core *.bak .depend
++
++#########################################################################
++
++.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
++ $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
++
++-include .depend
++
++#########################################################################
+diff -u -r --new-file u-boot-1.1.2/board/halogen/memsetup.S u-boot-1.1.2-neon/board/halogen/memsetup.S
+--- u-boot-1.1.2/board/halogen/memsetup.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/memsetup.S 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,64 @@
++/*
++ * Most of this taken from Redboot hal_platform_setup.h with cleanup
++ *
++ * NOTE: I haven't clean this up considerably, just enough to get it
++ * running. See hal_platform_setup.h for the source. See
++ * board/cradle/memsetup.S for another PXA250 setup that is
++ * much cleaner.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <config.h>
++#include <version.h>
++
++#define BAUDRATE 115200
++#include <asm/arch/platformTypes.h>
++#include <configs/select.h>
++#include <asm/arch/pxaGpio.h>
++#include <asm/arch/pxaMacro3.h>
++
++DRAM_SIZE: .long CFG_DRAM_SIZE
++
++/* wait for coprocessor write complete */
++ .macro CPWAIT reg
++ mrc p15,0,\reg,c2,c0,0
++ mov \reg,\reg
++ sub pc,pc,#4
++ .endm
++
++
++/*
++ * Memory setup
++ */
++
++.globl memsetup
++memsetup:
++
++ mov r10, lr
++
++ InitCS0_CS1 r0,sp
++ InitGPIO r0,sp
++ InitIC_Clocks r0,sp
++ InitUART r0,sp,UART_BASE,BAUDRATE
++ InitUART r0,sp,UART_BASE+0x600000,9600
++ InitChangeCPUSpeed r0
++ InitMemory r0,sp,r1
++
++ mov pc, lr
+diff -u -r --new-file u-boot-1.1.2/board/halogen/u-boot.lds u-boot-1.1.2-neon/board/halogen/u-boot.lds
+--- u-boot-1.1.2/board/halogen/u-boot.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/u-boot.lds 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(_start)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/start.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/board/halogen/u-bootmini.lds u-boot-1.1.2-neon/board/halogen/u-bootmini.lds
+--- u-boot-1.1.2/board/halogen/u-bootmini.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/halogen/u-bootmini.lds 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(StartUp)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/minidebug.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/board/neon/config.mk u-boot-1.1.2-neon/board/neon/config.mk
+--- u-boot-1.1.2/board/neon/config.mk 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/config.mk 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,4 @@
++#TEXT_BASE = 0xa1700000
++TEXT_BASE = 0xA1F00000
++#TEXT_BASE = 0
++#PXALCD = 1
+diff -u -r --new-file u-boot-1.1.2/board/neon/.cvsignore u-boot-1.1.2-neon/board/neon/.cvsignore
+--- u-boot-1.1.2/board/neon/.cvsignore 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/.cvsignore 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,2 @@
++.depend
++
+diff -u -r --new-file u-boot-1.1.2/board/neon/flash.c u-boot-1.1.2-neon/board/neon/flash.c
+--- u-boot-1.1.2/board/neon/flash.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/flash.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,482 @@
++/*
++ * (C) Copyright 2001
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2001
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <linux/byteorder/swab.h>
++#include <asm/arch/pxa250Base.h>
++#include <asm/arch/pxaHardware.h>
++#include "lcd.h"
++
++flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
++
++/* Board support for 1 or 2 flash devices */
++#define FLASH_PORT_WIDTH32
++#undef FLASH_PORT_WIDTH16
++
++#ifdef FLASH_PORT_WIDTH16
++#define FLASH_PORT_WIDTH ushort
++#define FLASH_PORT_WIDTHV vu_short
++#define SWAP(x) __swab16(x)
++#else
++#define FLASH_PORT_WIDTH ulong
++#define FLASH_PORT_WIDTHV vu_long
++#define SWAP(x) __swab32(x)
++#endif
++
++#define FPW FLASH_PORT_WIDTH
++#define FPWV FLASH_PORT_WIDTHV
++
++#define mb() __asm__ __volatile__ ("" : : : "memory")
++
++/*-----------------------------------------------------------------------
++ * Functions
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info);
++static int write_data (flash_info_t *info, ulong dest, FPW data);
++static void flash_get_offsets (ulong base, flash_info_t *info);
++void inline spin_wheel_init(ulong addr, ulong cnt);
++void inline spin_wheel_done( int worked );
++void inline spin_wheel (ulong numleft);
++
++/*-----------------------------------------------------------------------
++ */
++ulong bases[] = {PHYS_FLASH_1,PHYS_FLASH_2,1};
++unsigned long flash_init (void)
++{
++ int i=0;
++ int j=0;
++ ulong size = 0;
++ ulong base;
++
++ while (i < CFG_MAX_FLASH_BANKS) {
++ base = bases[j++];
++ flash_info[i].start[0] = 0;
++ if (base & 1) break;
++ if (flash_get_size ((FPW *) base, &flash_info[i])) {
++ flash_get_offsets (base, &flash_info[i]);
++ size += flash_info[i].size;
++ i++;
++ }
++ else {
++printf( "error reading flash size\n" );
++ }
++ }
++ if (size>0) {
++ base = flash_info[0].start[0];
++ // Protect monitor and environment sectors
++ flash_protect ( FLAG_PROTECT_SET,
++ base,
++ base + monitor_flash_len - 1,
++ &flash_info[0] );
++
++ flash_protect ( FLAG_PROTECT_SET,
++ base+CFG_ENV_OFFSET,
++ base+CFG_ENV_OFFSET + CFG_ENV_SIZE - 1, &flash_info[0] );
++ }
++
++ return size;
++}
++
++/*-----------------------------------------------------------------------
++ */
++static void flash_get_offsets (ulong base, flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return;
++ }
++
++ if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
++ for (i = 0; i < info->sector_count; i++) {
++ info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE);
++ info->protect[i] = 0;
++ }
++ }
++}
++
++/*-----------------------------------------------------------------------
++ */
++void flash_print_info (flash_info_t *info)
++{
++ int i;
++
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("missing or unknown FLASH type\n");
++ return;
++ }
++
++ switch (info->flash_id & FLASH_VENDMASK) {
++ case FLASH_MAN_INTEL:
++ printf ("INTEL ");
++ break;
++ default:
++ printf ("Unknown Vendor ");
++ break;
++ }
++
++ switch (info->flash_id & FLASH_TYPEMASK) {
++ case FLASH_28F128J3A:
++ printf ("28F128J3A\n");
++ break;
++ default:
++ printf ("Unknown Chip Type\n");
++ break;
++ }
++
++ printf (" Size: %ld MB in %d Sectors\n",
++ info->size >> 20, info->sector_count);
++
++ printf (" Sector Start Addresses:");
++ for (i = 0; i < info->sector_count; ++i) {
++ if ((i % 5) == 0)
++ printf ("\n ");
++ printf (" %08lX%s",
++ info->start[i],
++ info->protect[i] ? " (RO)" : " ");
++ }
++ printf ("\n");
++ return;
++}
++
++/*
++ * The following code cannot be run from FLASH!
++ */
++static ulong flash_get_size (FPW *addr, flash_info_t *info)
++{
++ volatile FPW value;
++ volatile unsigned long *mc = (unsigned long *)MEMORY_CONTROL_BASE;
++ unsigned long val = 1<<3;
++
++ info->flash_id = FLASH_UNKNOWN;
++ info->sector_count = 0;
++ info->size = 0;
++
++ if (((ulong)addr) > 0x14000000) return 0;
++ val = mc[(MSC0>>2) +(((ulong)addr)>>27)];
++ if (((ulong)addr) & 0x04000000) val = val>>16;
++ if ( val & (1<<3)) return 0; //if 16 bit bus then return
++
++ /* Write auto select command: read Manufacturer ID */
++ addr[0x5555] = (FPW) 0x00AA00AA;
++ addr[0x2AAA] = (FPW) 0x00550055;
++ addr[0x5555] = (FPW) 0x00900090;
++
++ mb ();
++ value = addr[0];
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) STM_MANUFACT:
++ case (FPW) INTEL_MANUFACT & 0xFF0000 :
++ case (FPW) INTEL_MANUFACT & 0x0000FF :
++ case (FPW) INTEL_MANUFACT:
++ info->flash_id = FLASH_MAN_INTEL;
++ break;
++
++ default:
++printf( "Invalid flash manufacturer %x\n", value );
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++ return (0); /* no or unknown flash */
++ }
++
++ mb ();
++ value = addr[1]; /* device ID */
++
++ switch (value) {
++
++ case (FPW) 0:
++ case (FPW) INTEL_ID_28F128J3A & 0xFF0000 :
++ case (FPW) INTEL_ID_28F128J3A & 0x0000FF :
++ case (FPW) INTEL_ID_28F128J3A:
++ info->flash_id += FLASH_28F128J3A;
++ info->sector_count = 128;
++ info->size = 0x02000000;
++ break; /* => 16 MB x 2 */
++ case (FPW) INTEL_ID_28F320J3A:
++ info->flash_id += FLASH_28F320J3A;
++ info->sector_count = 32 ;
++ info->size = 0x800000 ;
++ break; /* => 4 MB x 2 */
++ default:
++printf( "Unknown flash device %x\n", value );
++ info->flash_id = FLASH_UNKNOWN;
++ break;
++ }
++
++ if (info->sector_count > CFG_MAX_FLASH_SECT) {
++ printf ("** ERROR: sector count %d > max (%d) **\n",
++ info->sector_count, CFG_MAX_FLASH_SECT);
++ info->sector_count = CFG_MAX_FLASH_SECT;
++ }
++
++ addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
++
++ return (info->size);
++}
++
++
++/*-----------------------------------------------------------------------
++ */
++
++int flash_erase (flash_info_t *info, int s_first, int s_last)
++{
++ int flag, prot, sect;
++ ulong type, start, last;
++ int rcode = 0;
++
++ if ((s_first < 0) || (s_first > s_last)) {
++ if (info->flash_id == FLASH_UNKNOWN) {
++ printf ("- missing\n");
++ } else {
++ printf ("- no sectors to erase\n");
++ }
++ return 1;
++ }
++
++ type = (info->flash_id & FLASH_VENDMASK);
++ if ((type != FLASH_MAN_INTEL)) {
++ printf ("Can't erase unknown flash type %08lx - aborted\n",
++ info->flash_id);
++ return 1;
++ }
++
++ prot = 0;
++ for (sect = s_first; sect <= s_last; ++sect) {
++ if (info->protect[sect]) {
++ prot++;
++ }
++ }
++
++ if (prot) {
++ printf ("- Warning: %d protected sectors will not be erased!\n",
++ prot);
++ } else {
++ printf ("\n");
++ }
++
++ start = get_timer (0);
++ last = start;
++
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ /* Start erase on unprotected sectors */
++ for (sect = s_first; sect <= s_last; sect++) {
++ if (info->protect[sect] == 0) { /* not protected */
++ char temp[80];
++ FPWV *addr = (FPWV *) (info->start[sect]);
++ FPW status;
++
++ sprintf (temp, "Erasing sector %2d ... \r", sect);
++ lcd_puts( temp );
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ *addr = (FPW) 0x00500050; /* clear status register */
++ *addr = (FPW) 0x00200020; /* erase setup */
++ *addr = (FPW) 0x00D000D0; /* erase confirm */
++
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
++ printf ("Timeout\n");
++ *addr = (FPW) 0x00B000B0; /* suspend erase */
++ *addr = (FPW) 0x00FF00FF; /* reset to read mode */
++ rcode = 1;
++ break;
++ }
++ }
++
++ *addr = 0x00500050; /* clear status register cmd. */
++ *addr = 0x00FF00FF; /* resest to read mode */
++ }
++ }
++ lcd_puts( "\r\n" );
++ return rcode;
++}
++
++/*-----------------------------------------------------------------------
++ * Copy memory to flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ * 4 - Flash not identified
++ */
++
++int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
++{
++ ulong cp, wp;
++ FPW data;
++ int count, i, l, rc, port_width;
++
++ rc = 0 ;
++ if (info->flash_id == FLASH_UNKNOWN) {
++ return 4;
++ }
++/* get lower word aligned address */
++#ifdef FLASH_PORT_WIDTH16
++ wp = (addr & ~1);
++ port_width = 2;
++#else
++ wp = (addr & ~3);
++ port_width = 4;
++#endif
++
++ spin_wheel_init(addr,cnt);
++
++ /*
++ * handle unaligned start bytes
++ */
++ if ((l = addr - wp) != 0) {
++ data = 0;
++ for (i = 0, cp = wp; i < l; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++ for (; i < port_width && cnt > 0; ++i) {
++ data = (data << 8) | *src++;
++ --cnt;
++ ++cp;
++ }
++ for (; cnt == 0 && i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ }
++
++ /*
++ * handle word aligned part
++ */
++ count = 0;
++ while (cnt >= port_width) {
++ data = 0;
++ for (i = 0; i < port_width; ++i) {
++ data = (data << 8) | *src++;
++ }
++ if ((rc = write_data (info, wp, SWAP (data))) != 0) {
++ goto out;
++ }
++ wp += port_width;
++ cnt -= port_width;
++ if (count++ > 0x800) {
++ spin_wheel (cnt);
++ count = 0;
++ }
++ }
++
++ if (cnt) {
++ /*
++ * handle unaligned tail bytes
++ */
++ data = 0;
++ for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) {
++ data = (data << 8) | *src++;
++ --cnt;
++ }
++ for (; i < port_width; ++i, ++cp) {
++ data = (data << 8) | (*(uchar *) cp);
++ }
++
++ rc = write_data (info, wp, SWAP (data));
++ }
++
++out:
++ spin_wheel_done(0 == rc);
++ return rc ;
++}
++
++/*-----------------------------------------------------------------------
++ * Write a word or halfword to Flash, returns:
++ * 0 - OK
++ * 1 - write timeout
++ * 2 - Flash not erased
++ */
++static int write_data (flash_info_t *info, ulong dest, FPW data)
++{
++ FPWV *addr = (FPWV *) dest;
++ FPW old = *addr ;
++ ulong status;
++ int flag;
++
++ /* Check if Flash is (sufficiently) erased */
++ if ((old & data) != data) {
++ printf ("not erased at %08lx (%lx)\n", (ulong) addr, old);
++ return (2);
++ }
++
++ if( old != data )
++ {
++ /* Disable interrupts which might cause a timeout here */
++ flag = disable_interrupts ();
++
++ *addr = (FPW) 0x00400040; /* write setup */
++ *addr = data;
++
++ /* arm simple, non interrupt dependent timer */
++ reset_timer_masked ();
++
++ /* wait while polling the status register */
++ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
++ if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ return (1);
++ }
++ }
++ *addr = (FPW) 0x00FF00FF; /* restore read mode */
++ } /* need to program? */
++
++
++ return (0);
++}
++
++void inline spin_wheel_init(ulong addr, ulong cnt)
++{
++ char temp[80];
++ sprintf( temp,
++ "\nprogramming flash\n"
++ "%08lx->%08lx\n"
++ " ", addr, cnt );
++ lcd_puts( temp );
++}
++
++void inline spin_wheel_done( int worked )
++{
++ if( worked )
++ spin_wheel(0);
++ lcd_puts( worked ? "\ncompleted.\n" : "\nfailed!\n" );
++}
++
++void inline spin_wheel( ulong numleft )
++{
++ char temp[40];
++ sprintf( temp, "\r %08lx", numleft );
++ lcd_puts( temp );
++}
+diff -u -r --new-file u-boot-1.1.2/board/neon/init.script u-boot-1.1.2-neon/board/neon/init.script
+--- u-boot-1.1.2/board/neon/init.script 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/init.script 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,42 @@
++if fatload mmc 0 a0008000 logo*.bmp ; then
++ bmp info a0008000 ;
++ bmp display a0008000 ;
++else
++ lecho "No logo present" ;
++fi
++
++if fatload mmc 0 a2000000 uim* ; then
++ lecho 'load Linux'
++ if fatload mmc 0 a2200000 mmcinitrd* ; then
++ echo 'using initrd' ;
++ lecho "Booting Linux"
++ set bootargs root=/dev/ram0 console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1)
++ bootm a2000000 a2200000
++ else
++ echo 'testing cramfs img' ;
++ if fatload mmc 0 a2200000 cramfs* ; then
++ if cmp.b 00140000 a2200000 $filesize ; then
++ echo 'cramfs images match' ;
++ else
++ lecho 'filesystems differ...' ;
++ protect off all ;
++ erase 00140000 01ffffff ;
++ cp.b a2200000 00140000 $filesize ;
++ fi
++
++ set bootargs console=ttyS0,115200 debug=7 mtdparts=phys_mapped_flash:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs
++ lecho "Booting Linux"
++ bootm a2000000
++ fi
++ fi
++else
++ echo "No Linux kernel" ;
++fi
++
++lecho 'No Linux, try CE'
++
++if fatload mmc 0 A0030000 nk*.nb0 ; then
++ g A0030000 ;
++else
++ echo "No WinCE image" ;
++fi
+diff -u -r --new-file u-boot-1.1.2/board/neon/Makefile u-boot-1.1.2-neon/board/neon/Makefile
+--- u-boot-1.1.2/board/neon/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/Makefile 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,48 @@
++
++#
++# (C) Copyright 2000
++# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++#
++# See file CREDITS for list of people who contributed to this
++# project.
++#
++# 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
++#
++
++include $(TOPDIR)/config.mk
++
++LIB = lib$(BOARD).a
++
++OBJS := neon.o flash.o rtc_M41T81S.o
++SOBJS := memsetup.o
++
++$(LIB): $(OBJS) $(SOBJS)
++ $(AR) crv $@ $(OBJS) $(SOBJS)
++
++clean:
++ rm -f $(SOBJS) $(OBJS)
++
++distclean: clean
++ rm -f $(LIB) core *.bak .depend
++
++#########################################################################
++
++.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
++ $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
++
++-include .depend
++
++#########################################################################
+diff -u -r --new-file u-boot-1.1.2/board/neon/memsetup.S u-boot-1.1.2-neon/board/neon/memsetup.S
+--- u-boot-1.1.2/board/neon/memsetup.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/memsetup.S 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,64 @@
++/*
++ * Most of this taken from Redboot hal_platform_setup.h with cleanup
++ *
++ * NOTE: I haven't clean this up considerably, just enough to get it
++ * running. See hal_platform_setup.h for the source. See
++ * board/cradle/memsetup.S for another PXA250 setup that is
++ * much cleaner.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <config.h>
++#include <version.h>
++
++#define BAUDRATE 115200
++#include <asm/arch/platformTypes.h>
++#include <configs/select.h>
++#include <asm/arch/pxaGpio.h>
++#include <asm/arch/pxaMacro3.h>
++
++DRAM_SIZE: .long CFG_DRAM_SIZE
++
++/* wait for coprocessor write complete */
++ .macro CPWAIT reg
++ mrc p15,0,\reg,c2,c0,0
++ mov \reg,\reg
++ sub pc,pc,#4
++ .endm
++
++
++/*
++ * Memory setup
++ */
++
++.globl memsetup
++memsetup:
++
++ mov r10, lr
++
++ InitCS0_CS1 r0,sp
++ InitGPIO r0,sp
++ InitIC_Clocks r0,sp
++ InitUART r0,sp,UART_BASE,BAUDRATE
++ InitUART r0,sp,UART_BASE+0x600000,9600
++ InitChangeCPUSpeed r0
++ InitMemory r0,sp,r1
++
++ mov pc, lr
+diff -u -r --new-file u-boot-1.1.2/board/neon/neon.c u-boot-1.1.2-neon/board/neon/neon.c
+--- u-boot-1.1.2/board/neon/neon.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/neon.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,615 @@
++/*
++ * (C) Copyright 2002
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * (C) Copyright 2002
++ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
++ * Marius Groeger <mgroeger@sysgo.de>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <config.h>
++#include <common.h>
++#include <version.h>
++#include <stdarg.h>
++#include <linux/types.h>
++#include <devices.h>
++#include <lcd.h>
++#include <lcd_panels.h>
++
++#define FASTCLOCK1 0x291A0201 //faster pixel clock: P2S = 1, P2 = 9 (/6) ( panel source 1, divide by 6)
++ // V2S = 1, V2 = 10 (/12) ( crt source 1, divide by 12)
++ // M2S = 0, MR = 2 (/4) (sdram source 1, divide by 4)
++ // M1S = 0, MR = 1 (/2)
++ // miscTimReg[5:4] == 0 (336 MHz)
++ // / 6 == 56 MHz
++ //
++#define FASTCLOCK2 0x291A0201
++#define FASTCLOCK3 0x00080800
++
++#define SLOWCLOCK1 0x0A1A0201 //slow pixel clock: P2S = 0, P2 = 10 (/12) ( panel source 0, divide by 12)
++ // V2S = 1, V2 = 10 (/12) ( crt source 1, divide by 12)
++ // M2S = 0, MR = 2 (/4) (sdram source 1, divide by 4)
++ // M1S = 0, MR = 1 (/2)
++ // miscTimReg[5:4] == 0 (288 MHz)
++ // / 12 == 24 MHz
++ //
++#define SLOWCLOCK2 0x0A1A0A09
++#define SLOWCLOCK3 0x00090900
++
++unsigned long const fbStart = 0x0C000000 ;
++unsigned long const fbMax = 0x00800000 ; //
++
++unsigned long const mmioStart = 0xFE00000 ;
++unsigned long const mmioLength = 0x00200000 ;
++unsigned long const lcdPaletteRegs = 0xFE80400 ;
++unsigned long const crtPaletteRegs = 0xFE80C00 ;
++unsigned long paletteRegs = 0xFE80400 ;
++
++const unsigned int sm501_list1[]={
++ 0x0FE00000,
++ 0x00100000,0x00001002,0x00000000,0x00000000,0x07F127C0,0x05146732,0x40715128,0x00000000,
++ 0x00000000,0x00180002,0x00000002,0x00000002,0x00000000,0x00000000,0x0000001F,0x291A0201,
++ 0x0000001F,0x291A0201,0x00000007,0x291A0201,0x00018000,0x00000000,0x00000000,0x00000000,
++ 0x050100A0,0x00000000,0x00080800};
++
++const unsigned int sm501_list2[]={ 0x0fe80000,
++/* 80000 dispctrl */ 0x0F013100, // 0f0d0105
++/* 80004 pan */ 0x00000000,
++/* 80008 colorkey */ 0x00000000,
++/* 8000C fbaddr */ 0x00000000,
++/* 80010 offsetww */ 0x00000000, // ((LCD_XRES)<<16)+(LCD_XRES),
++/* 80014 fbwidth */ 0x00000000, // (LCD_XRES<<16),
++/* 80018 fbheight */ 0x00000000, // (LCD_YRES<<16),
++/* 8001C tllocate */ 0x00000000,
++/* 80020 brlocate */ 0x00000000, // ((LCD_YRES-1)<<16)+(LCD_XRES-1),
++/* 80024 htotal */ 0x00000000, // ((LCD_BEGIN_OF_LINE_WAIT_COUNT+
++/* */ // LCD_XRES+
++/* */ // LCD_END_OF_LINE_WAIT_COUNT+
++/* */ // LCD_HORIZONTAL_SYNC_PULSE_WIDTH-1)<<16)
++/* */ // +(LCD_XRES-1),
++/* 80028 hsync */ 0x00000000, // (LCD_HORIZONTAL_SYNC_PULSE_WIDTH<<16)
++/* */ // +(LCD_XRES+LCD_BEGIN_OF_LINE_WAIT_COUNT-1),
++/* 8002C vtotal */ 0x00000000, // ((LCD_BEGIN_FRAME_WAIT_COUNT+
++/* */ // LCD_YRES+
++/* */ // LCD_END_OF_FRAME_WAIT_COUNT+
++/* */ // LCD_VERTICAL_SYNC_PULSE_WIDTH-1)<<16)
++/* */ // +(LCD_YRES-1),
++/* 80030 vsync */ 0x00000000, // (LCD_VERTICAL_SYNC_PULSE_WIDTH<<16)
++/* */ // +(LCD_YRES+LCD_BEGIN_FRAME_WAIT_COUNT-1)
++};
++
++static unsigned const miscCtrl = 0x00000004 ;
++static unsigned const curClockReg = 0x0000003C ;
++static unsigned const pm0ClockReg = 0x00000044 ;
++static unsigned const pm1ClockReg = 0x0000004C ;
++static unsigned const miscTimReg = 0x00000068 ;
++
++static unsigned const dispctrlReg = 0x00080000 ;
++static unsigned const offsetReg = 0x00080010 ; // ((xres)<<16)+(xres),
++static unsigned const fbWidthReg = 0x00080014 ; // (xres<<16),
++static unsigned const fbHeightReg = 0x00080018 ; // (yres<<16),
++static unsigned const brLocateReg = 0x00080020 ; // ((yres-1)<<16)+(xres-1),
++static unsigned const hTotalReg = 0x00080024 ; // (left_margin+xres+right_margin+hsync_len-1) << 16
++ // + xres
++static unsigned const hSyncReg = 0x00080028 ; // (hsync_len<<16) + (xres+left_margin-1)
++static unsigned const vTotalReg = 0x0008002c ; // (top_margin+yres+lower_margin+vsync_len-1) << 16
++ // + yres-1
++static unsigned const vSyncReg = 0x00080030 ; // (vsync_len<<16) + yres+top_margin-1
++
++/*
++ * CRT regs
++ */
++static unsigned const crtctrlReg = 0x00080200 ;
++static unsigned const crtFbAddrReg = 0x00080204 ;
++static unsigned const crtFbOffsReg = 0x00080208 ;
++static unsigned const crtFbHTotReg = 0x0008020C ;
++static unsigned const crtFbHSynReg = 0x00080210 ;
++static unsigned const crtFbVTotReg = 0x00080214 ;
++static unsigned const crtFbVSynReg = 0x00080218 ;
++
++#define DISPCRTL_ENABLE 4
++
++#define CLOCK_ACTIVEHIGH 0
++#define CLOCK_ACTIVELOW (1<<14)
++#define CLOCK_ACTIVEMASK (1<<14)
++
++#define LCDTYPE_TFT 0
++#define LCDTYPE_STN12 (3<<18)
++#define LCDTYPE_MASK (3<<18)
++
++#define READREG( addr ) *( (unsigned long volatile *)((addr)+mmioStart) )
++#define STUFFREG( addr, value ) *( (unsigned long volatile *)((addr)+mmioStart) ) = (value)
++
++const unsigned int sm501_list3[]={0x0fe80040,
++ 0x00010000,0x0703E360,0x00200400,0x00A81330,0x0385009C,0x02200240,0x00000000,0x00000000,
++ 0x00EDEDED,0x089C4040,0x0031E3B0};
++
++const unsigned int sm501_list4[]={0x0fe80080,
++ 0x00010000,0x05121880,0x28800C00,0x00108030,0x02090040,0x00840050,0x00000000,0x00000000,
++ 0x0141A200,0x020A0802,0x0088D109,0x20820040,0x10800000,0x30029200,0x00080821,0x01010400,
++ 0x44000120,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
++ 0x00000000,0x00000000,0x00000000,0x00000000};
++
++const unsigned int sm501_list5[]={0x0fe800f0,
++ 0x0070F800,0x00780140,0x00000000,0x0000FFFF,0x00010000};
++
++struct itemEntry {
++ const int cnt;
++ const unsigned int* p;
++};
++
++const struct itemEntry lists[] = {
++ {sizeof(sm501_list1)>>2,sm501_list1},
++ {sizeof(sm501_list2)>>2,sm501_list2},
++ {sizeof(sm501_list3)>>2,sm501_list3},
++ {sizeof(sm501_list4)>>2,sm501_list4},
++ {sizeof(sm501_list5)>>2,sm501_list5}
++};
++
++int lcd_color_fg;
++int lcd_color_bg;
++
++void *lcd_base; /* Start of framebuffer memory */
++void *lcd_console_address; /* Start of console buffer */
++
++short console_col;
++short console_row;
++
++
++ulong calc_fbsize (void)
++{
++ if( cur_lcd_panel )
++ {
++ int line_length = (cur_lcd_panel->xres * NBITS (LCD_BPP)) / 8;
++ return ( cur_lcd_panel->yres * line_length ) + PAGE_SIZE ;
++ }
++ else
++ return 0 ;
++}
++
++void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
++{
++ unsigned long *const palette = (unsigned long *)paletteRegs ;
++ unsigned long const rgb = ((unsigned long)red ) << 16
++ | ((unsigned long)green ) << 8
++ | blue ;
++ palette[regno] = rgb ;
++}
++
++void lcd_ctrl_init (void *lcdbase)
++{
++ unsigned short *fbMem;
++ char *panelName ;
++
++ unsigned long val=0;
++ const struct itemEntry* l = lists;
++ int count = sizeof(lists)/sizeof(struct itemEntry);
++ printf( "sm501 init start\n");
++
++ while (count) {
++ int cnt = l->cnt-1;
++ const unsigned long* p = (unsigned long*)l->p;
++ volatile unsigned int* reg = (unsigned int*)(*p++);
++// printf( "set regs: %p, cnt:%x, from %p, l:%p\n", reg, cnt, p,l );
++// while (reg==0) {
++// }
++
++ while (cnt) {
++ val = *p++;
++// printf( "set reg: %p = %x from %p\n", reg, val, p );
++ *reg++ = val;
++ cnt--;
++ }
++ count--;
++ l++;
++ }
++// printf( "sm501 init middle\n");
++
++ panelName = getenv( "panel" );
++// printf( "after getenv\n");
++ if( panelName )
++ {
++ struct lcd_panel_info_t const *panel ;
++ panel = find_lcd_panel( panelName );
++ if( panel )
++ {
++ printf( "panel %s found: %u x %u\n", panelName, panel->xres, panel->yres );
++// printf( "before set_lcd_panel\n");
++ set_lcd_panel( panel );
++// printf( "after set_lcd_panel\n");
++ }
++ else
++ printf( "panel %s not found\n", panelName );
++ }
++
++ fbMem = (unsigned short *)fbStart ;
++ lcd_base = fbMem ;
++
++/*
++Settings for Hitachi 5.7
++ PANEL_HORIZONTAL_TOTAL, 01c00160);
++ PANEL_HORIZONTAL_SYNC, 00400161);
++ PANEL_VERTICAL_TOTAL, 0x010800f0);
++ PANEL_VERTICAL_SYNC, 0x00020104);
++
++In bdlogo.bmp - offset 436 is pixel data
++ STUFFREG( hTotalReg, 0x01800140 );
++ STUFFREG( hSyncReg, 0x0008014f );
++ STUFFREG( vTotalReg, 0x010700F0 );
++ STUFFREG( vSyncReg, 0x00020100 );
++*/
++ printf( "lcd_ctrl_init exit\n");
++}
++
++void lcd_enable (void)
++{
++}
++
++#define BIT29 (1<<29)
++
++static void setClockReg( unsigned reg, unsigned long value )
++{
++ unsigned oldValue = READREG( reg );
++ if( (oldValue & BIT29) != (value&BIT29) )
++ {
++ oldValue = (oldValue & (~BIT29))
++ | (value & BIT29);
++ STUFFREG( reg, oldValue );
++ udelay(16000);
++ }
++
++ if( oldValue != value )
++ STUFFREG( reg, value );
++}
++
++vidinfo_t panel_info = {
++ vl_col: 320, //this is corrected in SetPanelInfo
++ vl_row: 240,
++ vl_bpix: LCD_BPP,
++ vl_lcd_line_length: (320 * NBITS(LCD_BPP) ) >> 3
++};
++
++static void SetPanelInfo(struct lcd_panel_info_t const *panel)
++{
++ panel_info.vl_col = panel->xres;
++ panel_info.vl_row = panel->yres;
++ panel_info.vl_bpix = LCD_BPP;
++ panel_info.vl_lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) >> 3;
++ printf("panel: %ix%ix%i\n",panel_info.vl_col,panel_info.vl_row,(1<<panel_info.vl_bpix));
++}
++
++static unsigned long clockRegs[] = {
++ SLOWCLOCK1, SLOWCLOCK2,
++ FASTCLOCK1, FASTCLOCK2
++};
++
++static unsigned const numClockRegs = sizeof(clockRegs)/sizeof(clockRegs[0])/2 ;
++
++/*
++ * The following tables were built by screen-scraping and sorting
++ * the tables in the SM501 manual:
++ *
++ * Fields are:
++ * frequency in Hz
++ * clock source (0 == 288MHz, 1 == 366 MHz)
++ * select bits (5 bits for panels, 4 bits for CRTs)
++ */
++#define ENTRIESPERFREQ 3
++unsigned long const panelFrequencies[] = {
++ 450000/2, 0<<29, 0x17<<24,
++ 525000/2, 1<<29, 0x17<<24,
++ 750000/2, 0<<29, 0x0f<<24,
++ 875000/2, 1<<29, 0x0f<<24,
++ 900000/2, 0<<29, 0x16<<24,
++ 1050000/2, 1<<29, 0x16<<24,
++ 1500000/2, 0<<29, 0x0e<<24,
++ 1750000/2, 1<<29, 0x0e<<24,
++ 1800000/2, 0<<29, 0x15<<24,
++ 2100000/2, 1<<29, 0x15<<24,
++ 2250000/2, 0<<29, 0x07<<24,
++ 2625000/2, 1<<29, 0x07<<24,
++ 3000000/2, 0<<29, 0x0d<<24,
++ 3500000/2, 1<<29, 0x0d<<24,
++ 3600000/2, 0<<29, 0x14<<24,
++ 4200000/2, 1<<29, 0x14<<24,
++ 4500000/2, 0<<29, 0x06<<24,
++ 5250000/2, 1<<29, 0x06<<24,
++ 6000000/2, 0<<29, 0x0c<<24,
++ 7000000/2, 1<<29, 0x0c<<24,
++ 7200000/2, 0<<29, 0x13<<24,
++ 8400000/2, 1<<29, 0x13<<24,
++ 9000000/2, 0<<29, 0x05<<24,
++ 10500000/2, 1<<29, 0x05<<24,
++ 12000000/2, 0<<29, 0x0b<<24,
++ 14000000/2, 1<<29, 0x0b<<24,
++ 14400000/2, 0<<29, 0x12<<24,
++ 16800000/2, 1<<29, 0x12<<24,
++ 18000000/2, 0<<29, 0x04<<24,
++ 21000000/2, 1<<29, 0x04<<24,
++ 24000000/2, 0<<29, 0x0a<<24,
++ 28000000/2, 1<<29, 0x0a<<24,
++ 28800000/2, 0<<29, 0x11<<24,
++ 33600000/2, 1<<29, 0x11<<24,
++ 36000000/2, 0<<29, 0x03<<24,
++ 42000000/2, 1<<29, 0x03<<24,
++ 48000000/2, 0<<29, 0x09<<24,
++ 56000000/2, 1<<29, 0x09<<24,
++ 57600000/2, 0<<29, 0x10<<24,
++ 67200000/2, 1<<29, 0x10<<24,
++ 72000000/2, 0<<29, 0x02<<24,
++ 84000000/2, 1<<29, 0x02<<24,
++ 96000000/2, 0<<29, 0x08<<24,
++ 112000000/2, 1<<29, 0x08<<24,
++ 144000000/2, 0<<29, 0x01<<24,
++ 168000000/2, 1<<29, 0x01<<24,
++ 288000000/2, 0<<29, 0x00<<24,
++ 336000000/2, 1<<29, 0x00<<24
++};
++#define numPanelFrequencies (sizeof(panelFrequencies)/sizeof(panelFrequencies[0])/ENTRIESPERFREQ)
++
++unsigned long const crtFrequencies[] = {
++ 750000/2, 0<<20, 0x0f<<16,
++ 875000/2, 1<<20, 0x0f<<16,
++ 1500000/2, 0<<20, 0x0e<<16,
++ 1750000/2, 1<<20, 0x0e<<16,
++ 2250000/2, 0<<20, 0x07<<16,
++ 2625000/2, 1<<20, 0x07<<16,
++ 3000000/2, 0<<20, 0x0d<<16,
++ 3500000/2, 1<<20, 0x0d<<16,
++ 4500000/2, 0<<20, 0x06<<16,
++ 5250000/2, 1<<20, 0x06<<16,
++ 6000000/2, 0<<20, 0x0c<<16,
++ 7000000/2, 1<<20, 0x0c<<16,
++ 9000000/2, 0<<20, 0x05<<16,
++ 10500000/2, 1<<20, 0x05<<16,
++ 12000000/2, 0<<20, 0x0b<<16,
++ 14000000/2, 1<<20, 0x0b<<16,
++ 18000000/2, 0<<20, 0x04<<16,
++ 21000000/2, 1<<20, 0x04<<16,
++ 24000000/2, 0<<20, 0x0a<<16,
++ 28000000/2, 1<<20, 0x0a<<16,
++ 36000000/2, 0<<20, 0x03<<16,
++ 42000000/2, 1<<20, 0x03<<16,
++ 48000000/2, 0<<20, 0x09<<16,
++ 56000000/2, 1<<20, 0x09<<16,
++ 72000000/2, 0<<20, 0x02<<16,
++ 84000000/2, 1<<20, 0x02<<16,
++ 96000000/2, 0<<20, 0x08<<16,
++ 112000000/2, 1<<20, 0x08<<16,
++ 144000000/2, 0<<20, 0x01<<16,
++ 168000000/2, 1<<20, 0x01<<16,
++ 288000000/2, 0<<20, 0x00<<16,
++ 336000000/2, 1<<20, 0x00<<16
++};
++#define numCrtFrequencies (sizeof(crtFrequencies)/sizeof(crtFrequencies[0])/ENTRIESPERFREQ)
++
++unsigned long const * const frequencies[] = {
++ panelFrequencies,
++ crtFrequencies
++};
++
++unsigned const numFrequencies[] = {
++ numPanelFrequencies,
++ numCrtFrequencies
++};
++
++static unsigned long const clockMasks[] = {
++ 0x3F<<24,
++ 0x1F<<16
++};
++
++static void updateCRT( unsigned long const *freq,
++ struct lcd_panel_info_t const *panel )
++{
++ unsigned long reg ;
++ unsigned long crtCtrl = 0x00010304 ; // FIFO 3 or more, CRT Timing, CRT data, enable 8-bit
++ if( panel->act_high )
++ crtCtrl |= (3<<14); // horizontal and vertical phase
++ STUFFREG( crtFbAddrReg, 0 );
++ STUFFREG( crtFbOffsReg, ((panel->xres)<<16)+(panel->xres) );
++ STUFFREG( crtFbHTotReg, (( panel->left_margin
++ +panel->xres
++ +panel->right_margin
++ +panel->hsync_len - 1) << 16 )
++ + panel->xres-1 );
++ STUFFREG( crtFbHSynReg, (panel->hsync_len<<16)+ (panel->xres+panel->left_margin-1) );
++ STUFFREG( crtFbVTotReg, (( panel->upper_margin
++ +panel->yres
++ +panel->lower_margin
++ +panel->vsync_len-1 ) << 16 )
++ + panel->yres-1 );
++ STUFFREG( crtFbVSynReg,(panel->vsync_len<<16)
++ + panel->yres+panel->upper_margin-1 );
++ STUFFREG( crtctrlReg, crtCtrl ); // enable
++
++ reg = READREG( miscCtrl ) & ~0x1000 ;
++ STUFFREG( miscCtrl, reg );
++}
++
++void set_lcd_panel( struct lcd_panel_info_t const *panel )
++{
++ unsigned long dispctrl = READREG( dispctrlReg );
++ dispctrl &= ~(CLOCK_ACTIVEMASK|LCDTYPE_MASK);
++ if( !panel->act_high )
++ dispctrl |= CLOCK_ACTIVELOW ;
++ else
++ dispctrl &= ~CLOCK_ACTIVEMASK ;
++
++ if( !panel->active )
++ dispctrl |= LCDTYPE_STN12 ;
++ else
++ dispctrl &= ~LCDTYPE_MASK ;
++
++ if (panel->crt==0) dispctrl |= 4;
++
++ STUFFREG( offsetReg, ((panel->xres)<<16)+(panel->xres) );
++ STUFFREG( fbWidthReg, (panel->xres<<16) );
++ STUFFREG( fbHeightReg, (panel->yres<<16) );
++ STUFFREG( brLocateReg, ((panel->yres-1)<<16)+(panel->xres-1) );
++ STUFFREG( hTotalReg, (( panel->left_margin
++ +panel->xres
++ +panel->right_margin
++ +panel->hsync_len - 1) << 16 )
++ + panel->xres-1 );
++ STUFFREG( hSyncReg, (panel->hsync_len<<16)+ (panel->xres+panel->left_margin-1) );
++ STUFFREG( vTotalReg, (( panel->upper_margin
++ +panel->yres
++ +panel->lower_margin
++ +panel->vsync_len-1 ) << 16 )
++ + panel->yres-1 );
++ STUFFREG( vSyncReg, (panel->vsync_len<<16)
++ + panel->yres+panel->upper_margin-1 );
++
++ if( panel->pixclock < numClockRegs )
++ {
++ unsigned long const *clk = clockRegs+(panel->pixclock*2);
++ setClockReg( curClockReg, *clk );
++ setClockReg( pm0ClockReg, *clk++ );
++ setClockReg( pm1ClockReg, *clk );
++ }
++ else
++ {
++ int const isCRT = (0 != panel->crt);
++ int crt ;
++
++ for( crt = 0 ; crt < 2 ; crt++ )
++ {
++ unsigned long reg ;
++ unsigned long const *freq = frequencies[crt];
++ unsigned const count = numFrequencies[crt];
++
++ unsigned long f, diffl, diffh ;
++ int i ;
++ unsigned long low, high ;
++
++ //
++ // linear scan for closest frequency
++ //
++ for( i = 0 ; i < count ; i++, freq += ENTRIESPERFREQ )
++ {
++ if( *freq > panel->pixclock )
++ break;
++ }
++
++ low = (i > 0)
++ ? freq[0-ENTRIESPERFREQ]
++ : 0 ;
++ diffl = panel->pixclock - low ;
++
++ high = (i < count )
++ ? *freq
++ : 0xFFFFFFFF ;
++ diffh = high - panel->pixclock ;
++
++ if( diffh < diffl )
++ {
++ f = high ;
++ }
++ else
++ {
++ f = low ;
++ freq-- ;
++ }
++
++ printf( "pixclock == %lu, frequency %u/%u -> %lu\n",
++ panel->pixclock, low, high, f );
++
++ reg = READREG( curClockReg ) & ~(clockMasks[crt]);
++
++ // Clock source
++ printf( "source %u, divisor %u\n", freq[1], freq[2] );
++ reg |= freq[1];
++ reg |= freq[2];
++
++ setClockReg( curClockReg, reg );
++ setClockReg( pm0ClockReg, reg );
++ setClockReg( pm1ClockReg, reg );
++
++ if( isCRT )
++ {
++ paletteRegs = crtPaletteRegs ;
++ updateCRT( freq, panel );
++ }
++ else
++ paletteRegs = lcdPaletteRegs ;
++ }
++ }
++ STUFFREG( dispctrlReg, dispctrl );
++ cur_lcd_panel = panel ;
++ SetPanelInfo(panel);
++}
++
++void disable_lcd_panel( void )
++{
++ unsigned long dispctrl = READREG( dispctrlReg );
++ unsigned long crtctrl = READREG( crtctrlReg );
++
++ dispctrl &= ~(DISPCRTL_ENABLE);
++ STUFFREG( dispctrlReg, dispctrl );
++
++ crtctrl &= ~(DISPCRTL_ENABLE);
++ STUFFREG( crtctrlReg, crtctrl );
++}
++
++/* ------------------------------------------------------------------------- */
++
++
++/*
++ * Miscelaneous platform dependent initialisations
++ */
++
++int board_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ /* memory and cpu-speed are setup before relocation */
++ /* so we do _nothing_ here */
++
++ /* arch number of Neon Board */
++ gd->bd->bi_arch_number = MACH_TYPE_BD2003 ;
++
++ /* adress of boot parameters */
++ gd->bd->bi_boot_params = 0xa0000100;
++
++ /* address of frame buffer */
++ gd->fb_base = fbStart ;
++
++ return 0;
++}
++
++int board_late_init(void)
++{
++ setenv("stdout", "serial");
++ setenv("stderr", "serial");
++ return 0;
++}
++
++
++int dram_init (void)
++{
++ DECLARE_GLOBAL_DATA_PTR;
++
++ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
++ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
++
++ return 0;
++}
+diff -u -r --new-file u-boot-1.1.2/board/neon/rtc_M41T81S.c u-boot-1.1.2-neon/board/neon/rtc_M41T81S.c
+--- u-boot-1.1.2/board/neon/rtc_M41T81S.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/rtc_M41T81S.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,663 @@
++/*
++ * M41T81S:
++ *
++ * This module defines a single 'rtc' command to read/write or
++ * test the ST Micro Real Time Clock attached to the SM-501
++ * I2C pins.
++ *
++ * If called with no parameters, it will display the current time
++ * to the console device and set the 'time' environment variable.
++ *
++ * If called with a single parameter of "test", it will read the
++ * current time, wait a second and read the current time again.
++ * It will return success (zero) if the RTC time appears to tick
++ * by 1 second.
++ *
++ * If called with one or two parameters that appear to fit an
++ * ISO 8601 time format (i.e. YYYY-MM-DD HH:MM:SS.00 ), it will
++ * set the date and time.
++ *
++ * Copyright (c) Boundary Devices, 2006
++ *
++ */
++#include "sm501.h"
++#include <config.h>
++#include <common.h>
++#include <version.h>
++#include <stdarg.h>
++#include <command.h>
++
++int WriteI2C(int bVal);
++int ReadI2C(int ack);
++int I2CStart(int bSlaveAddress);
++void I2CStop(void);
++void I2CInit(void);
++
++//////////////////////////////////////////////////////////
++
++#define SM501_GPIO_DATA 0x10000
++#define SM501_GPIO_DIR 0x10008
++
++#define INPUT 0
++#define OUTPUT 1
++
++#define I2C_CLK 46
++#define I2C_DATA 47
++#define GPBIT_MASK(bitnum) (1<<(bitnum&0x1f))
++#define GPBIT_TEST(bitnum) ( (ReadReg(SM501_GPIO_DATA + ((bitnum>>5)<<2))) & (1<<(bitnum&0x1f)) )
++#define GPBIT_TESTBIT(c,bitnum) ( c & (1<<(bitnum&0x1f)) )
++#define GPBIT_SET(x,bitnum,value) ( (value) ? ((x) | (1<<(bitnum&0x1f))) : ((x) & ~(1<<(bitnum&0x1f))) )
++
++//0.400 Mhz protocol = 1/.4 uSec = 10/4 uSec = 2.5 uSec
++//4 should be safe
++#define I2CWait 4
++#define LongBusWait 8
++#define StartBusWait 12
++
++typedef struct {
++ unsigned short wYear;
++ unsigned short wMonth;
++ unsigned short wDayOfWeek;
++ unsigned short wDay;
++ unsigned short wHour;
++ unsigned short wMinute;
++ unsigned short wSecond;
++ unsigned short wMilliseconds;
++} SYSTEMTIME ;
++
++typedef SYSTEMTIME *LPSYSTEMTIME ;
++
++void I2CInit(void)
++{
++ int i;
++
++ for(i=0; i<9; i++)
++ {
++ I2CStop();
++ }
++}
++
++
++#define ReadReg(reg) READ_SM501_REG(reg)
++#define WriteReg(reg,data) STUFF_SM501_REG((reg), (data))
++
++void SetVal_ClkData(int clk,int data)
++{
++#if (I2C_DATA>>5)==(I2C_CLK>>5)
++ ulong c = ReadReg( SM501_GPIO_DATA + ((I2C_DATA>>5)<<2) );
++ c = GPBIT_SET(c, I2C_DATA, data);
++ c = GPBIT_SET(c, I2C_CLK, clk);
++ WriteReg(SM501_GPIO_DATA + ((I2C_DATA>>5)<<2), c);
++#else
++ ulong c = ReadReg( SM501_GPIO_DATA + ((I2C_DATA>>5)<<2) );
++ c = GPBIT_SET(c, I2C_DATA, data);
++ WriteReg(SM501_GPIO_DATA + ((I2C_DATA>>5)<<2), c);
++
++ c = ReadReg( SM501_GPIO_DATA + ((I2C_CLK>>5)<<2) );
++ c = GPBIT_SET(c, I2C_CLK, clk);
++ WriteReg(SM501_GPIO_DATA + ((I2C_CLK>>5)<<2), c);
++#endif
++}
++
++void SetDir_ClkData(int clk,int data)
++{
++ ulong c,c1;
++#if (I2C_DATA>>5)==(I2C_CLK>>5)
++ c = ReadReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2) );
++ if (clk==OUTPUT) {
++ //will be low, and can then change data
++ c1 = GPBIT_SET(c, I2C_CLK, OUTPUT);
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2), c1);
++ c = GPBIT_SET(c1, I2C_DATA, data);
++ } else {
++ //clk might be low currently, so change data 1st
++ c1 = GPBIT_SET(c, I2C_DATA, data);
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_DATA>>5)<<2), c1);
++ c = GPBIT_SET(c1, I2C_CLK, INPUT);
++ }
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2), c);
++#else
++ if (clk==OUTPUT) {
++ //will be low, and can then change data
++ c = ReadReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2) );
++ c1 = GPBIT_SET(c, I2C_CLK, OUTPUT);
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2), c1);
++
++ c1 = ReadReg( SM501_GPIO_DIR + ((I2C_DATA>>5)<<2) );
++ c = GPBIT_SET(c1, I2C_DATA, data);
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_DATA>>5)<<2), c);
++ } else {
++ //clk might be low currently, so change data 1st
++ c = ReadReg( SM501_GPIO_DIR + ((I2C_DATA>>5)<<2) );
++ c1 = GPBIT_SET(c, I2C_DATA, data);
++ if (c!=c1) WriteReg( SM501_GPIO_DIR + ((I2C_DATA>>5)<<2), c1);
++
++ c1 = ReadReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2) );
++ c = GPBIT_SET(c1, I2C_CLK, INPUT);
++ if (c!=c1) c1WriteReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2), c);
++ }
++#endif
++}
++void SetDir_Clk(int clk)
++{
++ ulong c = ReadReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2) );
++ c = GPBIT_SET(c, I2C_CLK, clk);
++ WriteReg( SM501_GPIO_DIR + ((I2C_CLK>>5)<<2), c);
++}
++
++void I2CStop()
++{
++ SetDir_Clk(OUTPUT); //low clock
++ udelay(I2CWait);
++ SetDir_ClkData(OUTPUT,OUTPUT); //low clock, low data
++ udelay(I2CWait);
++
++ //Drive Write SCL High
++ SetDir_Clk(INPUT); //high clock
++ udelay(I2CWait);
++
++ // Drive Write SDA High
++ SetDir_ClkData(INPUT,INPUT); //transition on data from low to high while clock is high is a stop control signal
++ udelay(LongBusWait);
++
++}
++
++
++//return 0 for success
++int WriteI2C(int bVal)
++{
++
++ int mask;
++ int i;
++
++ // Enable Write SDA and SCL, and Drv SCL low
++ SetDir_Clk(OUTPUT); //clock low
++ udelay(I2CWait); //hold time
++
++ for (mask=0x80; mask; mask>>=1)
++ {
++ SetDir_ClkData(OUTPUT, (bVal & mask) ? INPUT : OUTPUT); // Write data bits to SDA
++ udelay(LongBusWait);
++
++ SetDir_Clk(INPUT); // Drv CLK High
++ udelay(I2CWait);
++
++ SetDir_Clk(OUTPUT); // Drv CLK Low
++ udelay(I2CWait); //hold time after clock goes low
++ }
++
++
++ SetDir_ClkData(OUTPUT,INPUT); // Disable Write SDA
++ udelay(LongBusWait); //wait for acknowledge to be placed on SDA
++ SetDir_Clk(INPUT); // Drive Clock High
++
++ // Read SDA, until SDA==0
++ for (i=0; i<255; i++) {
++ udelay(LongBusWait);
++ if (!GPBIT_TEST(I2C_DATA)) {
++ SetDir_Clk(OUTPUT); // Drv Clk LOW
++ return 0; //success
++ }
++ }
++
++ printf( "WriteI2C(%i) failed\n", bVal );
++ return -1;
++}
++
++int ReadI2C(int ack)
++{
++ int mask;
++ int byRet = 0;
++
++// SetVal_ClkData(0,0);
++ SetDir_Clk(OUTPUT); //clock low
++ udelay(I2CWait); //hold time
++
++ SetDir_ClkData(OUTPUT,INPUT); //clock low, data input
++ for (mask=0x80; mask; mask>>=1)
++ {
++ // Disable Write SDA, Drive SCL to LOW
++ SetDir_Clk(OUTPUT); //clock low
++ udelay(LongBusWait);
++
++ // Enable Write SCL, Drive SCL to HIGH
++ SetDir_Clk(INPUT); //clock high
++ udelay(I2CWait);
++
++ // Read data bits from SDA
++ if (GPBIT_TEST(I2C_DATA)) byRet |= mask; //sample data bit
++ }
++
++ SetDir_Clk(OUTPUT); //clock low
++ udelay(I2CWait); //let them stop driving data line
++
++ if (ack) {
++ SetDir_ClkData(OUTPUT,OUTPUT); //clock low, data low for ack
++ }
++ udelay(I2CWait);
++ SetDir_Clk(INPUT); //clock high
++ udelay(I2CWait); //wait ack/noack phase
++ return byRet;
++
++}
++
++int I2CStart(int SlaveAddress)
++{
++ int ret;
++ udelay(I2CWait);
++ // Enable Write SDA and Write SCL, and drive them high
++ SetDir_ClkData(INPUT,INPUT);
++ SetVal_ClkData(0,0); //they float high anyway
++ udelay(StartBusWait);
++
++ // Drive Data
++ SetDir_ClkData(INPUT,OUTPUT); //drive data low, (high to low transition on data, while clock high is start signal)
++ udelay(StartBusWait);
++
++ ret = WriteI2C(SlaveAddress);
++ if (ret) {
++ printf( "I2CStart failed write of device address\n" );
++ }
++ return ret;
++}
++
++#define M41T81S_SlaveAddrWrite 0xd0
++#define M41T81S_SlaveAddrRead 0xd1
++
++#define M_HUNDREDTHS 0 //00-99 BCD
++#define M_SECONDS 1 //00-59 BCD, bit 7 ST (oscillator is stopped bit)
++#define M_MINUTES 2 //00-59 BCD
++#define M_HOURS 3 //high 2 bits are CENTURY, low 6 BCD 00-23
++#define M_WEEKDAY 4 //01-07
++#define M_DAY 5 //01-31 BCD
++#define M_MONTH 6 //01-12 BCD
++#define M_YEAR 7 //00-99 BCD
++#define M_CALIBRATION 8
++#define M_WATCHDOG 9
++#define M_ALARM_MOTH 0x0a //01-12 BCD, high 3 bits enable
++#define M_ALARM_DAY 0x0b //01-31 BCD. high 2 bits RPT4, RPT5
++#define M_ALARM_HOUR 0x0c //00-23 BCD, high 2 bits RPT3, HT
++#define M_ALARM_MINUTES 0x0d //00-59 BCD, high bit RPT2
++#define M_ALARM_SECONDS 0x0e //00-59 BCD, high bit RPT1
++#define M_FLAGS 0x0f //bit 7(WDF), 6(AF), 4(BL), 2(OF)
++#define M_SQW 0x13 //bit 7(RS3), 6(RS2), 5(RS1), 4(RS0)
++
++//M_FLAGS bit mask definitions
++#define MF_WDF 0x80 //Watchdog flag
++#define MF_AF 0x40 //Alarm flag
++#define MF_BL 0x10 //Battery low
++#define MF_OF 0x04 //Oscillator fail
++static int bcd(int val,int low, int high)
++{
++ int tens = val>>4;
++ int ones = val & 0xf;
++ if ((tens > 9) || (ones > 9)) return -1;
++ val = (tens*10) + ones;
++ if ((val < low) || (val > high)) return -1;
++ return val;
++}
++static unsigned char toBcd(int val)
++{
++ int tens = val/10;
++ int rem = val - (tens*10);
++ if (tens >= 10) tens = tens % 10;
++ return (tens<<4) | rem;
++}
++
++static int GetTime(LPSYSTEMTIME lpst)
++{
++ unsigned char b[M_YEAR+1];
++ unsigned char * p = b;
++ unsigned char flags;
++ int i;
++ I2CInit(); //send a bunch of stops
++
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_ALARM_HOUR)) return -1;
++ if (I2CStart(M41T81S_SlaveAddrRead)) return -1;
++
++ b[0] = (unsigned char)ReadI2C(0); //read Halt bit
++ I2CStop();
++
++ if (b[0] & 0x40) {
++ //halted, restart it
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_ALARM_HOUR)) return -1;
++ if (WriteI2C(b[0] & ~0x40)) return -1; //clear Halt bit
++ I2CStop();
++ }
++
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_HUNDREDTHS)) return -1;
++ if (I2CStart(M41T81S_SlaveAddrRead)) return -1;
++ for (i=0; i<M_YEAR; i++) *p++ = (unsigned char)ReadI2C(1);
++ *p++ = (unsigned char)ReadI2C(0); //read year
++ I2CStop();
++
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_FLAGS)) return -1;
++ if (I2CStart(M41T81S_SlaveAddrRead)) return -1;
++ flags = (unsigned char)ReadI2C(0); //read flags
++ I2CStop();
++
++ if (flags & MF_BL) {
++ printf( "M41T81S_GetTime: Battery low\n" );
++ }
++ if (flags & MF_OF) {
++ printf( "M41T81S_GetTime: Oscillator failed\n" );
++
++ //stop oscillator
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_SECONDS)) return -1;
++ if (WriteI2C(b[M_SECONDS] | 0x80)) return -1; //set stop bit
++ I2CStop();
++
++ //start oscillator
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_SECONDS)) return -1;
++ if (WriteI2C(b[M_SECONDS] & ~0x80)) return -1; //clear stop bit
++ I2CStop();
++ }
++
++
++ lpst->wYear = ( (b[M_YEAR] > 0x99) || ((b[M_YEAR]&0xf) > 0x9) ) ? 0 :
++ (bcd(b[M_YEAR],0,99) + ( (b[M_HOURS]&0x40) ? 2100 : 2000));
++ lpst->wMonth = bcd(b[M_MONTH],1,12);
++ lpst->wDayOfWeek = bcd(b[M_WEEKDAY],1,7);
++ lpst->wDay = bcd(b[M_DAY],1,31);
++ lpst->wHour = bcd(b[M_HOURS]&0x3f,0,23);
++ lpst->wMinute = bcd(b[M_MINUTES],0,59);
++ lpst->wSecond = bcd(b[M_SECONDS]&0x7f,0,59);
++ lpst->wMilliseconds = bcd(b[M_HUNDREDTHS],0,99)*10;
++
++ if (b[M_SECONDS] & 0x80) {
++ //oscillator is stopped, restart it
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_SECONDS)) return -1;
++ if (WriteI2C(b[M_SECONDS] & ~0x80)) return -1; //clear stop bit
++ I2CStop();
++ }
++
++/*
++ printf( "M41T81S_GetTime: Year:%u, Month:%u, Day:%u, Hour:%u, Minute:%u, second:%u, milli:%u\n",
++ lpst->wYear, lpst->wMonth,lpst->wDay, lpst->wHour, lpst->wMinute, lpst->wSecond,lpst->wMilliseconds );
++*/
++ if (flags & MF_OF) {
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_FLAGS)) return -1;
++ if (WriteI2C(flags & ~MF_OF)) return -1; //clear oscillator failed bit
++ I2CStop();
++ }
++ return 0;
++}
++
++static int SetTime(LPSYSTEMTIME lpst)
++{
++ unsigned char b[M_YEAR+1];
++ unsigned char flags;
++ int i;
++ if (lpst->wYear < 2004) {
++ lpst->wYear = 2004; //don't allow it to be set in the far past.
++ lpst->wMonth = 1;
++ lpst->wDay = 1;
++ lpst->wDayOfWeek = 4; //Thursday Jan. 1, 2004
++ }
++
++/* printf( "M41T81S_SetTime: Year:%u, Month:%u, Day:%u, Hour:%u, Minute:%u, second:%u, milli:%u\n",
++ lpst->wYear, lpst->wMonth,lpst->wDay, lpst->wHour, lpst->wMinute, lpst->wSecond,lpst->wMilliseconds );
++*/
++ b[M_HUNDREDTHS] = 0; //toBcd(lpst->wMilliseconds/10);
++ b[M_SECONDS] = toBcd(lpst->wSecond);
++ b[M_MINUTES] = toBcd(lpst->wMinute);
++ b[M_HOURS] = toBcd(lpst->wHour) | ( ((lpst->wYear % 200) >= 100) ? 0xc0 : 0x80);
++ b[M_WEEKDAY] = (unsigned char)lpst->wDayOfWeek;
++ b[M_DAY] = toBcd(lpst->wDay);
++ b[M_MONTH] = toBcd(lpst->wMonth);
++ b[M_YEAR] = toBcd( lpst->wYear % 100);
++
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_HUNDREDTHS)) return -1;
++
++ for (i=M_HUNDREDTHS; i<=M_YEAR; i++) {
++ if (WriteI2C(b[i])) return -1;
++ }
++ I2CStop();
++
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_FLAGS)) return -1;
++ if (I2CStart(M41T81S_SlaveAddrRead)) return -1;
++ flags = (unsigned char)ReadI2C(0); //read flags
++ I2CStop();
++
++/* printf( "M41T81S_SetTime: Year:%u, Month:%u, Day:%u, Weekday:%u, Hour:%u, Minute:%u, second:%u flags:%u\n",
++ lpst->wYear, lpst->wMonth, lpst->wDay, lpst->wDayOfWeek, lpst->wHour, lpst->wMinute, lpst->wSecond, flags );
++*/
++
++ if (flags & MF_OF) {
++ if (I2CStart(M41T81S_SlaveAddrWrite)) return -1;
++ if (WriteI2C(M_FLAGS)) return -1;
++ if (WriteI2C(flags & ~MF_OF)) return -1; //clear oscillator failed bit
++ I2CStop();
++ }
++ return 0;
++}
++
++int M41T81S_GetTime(LPSYSTEMTIME lpst)
++{
++ int ret;
++ int reg = (READ_SM501_REG(SMIR_POWER_MODE_CONTROL) & 1) ? SMIR_PWRM1_GATE : SMIR_PWRM0_GATE;
++ int gate = READ_SM501_REG(reg);
++ if ((gate & 0x40)==0) STUFF_SM501_REG(reg, gate | 0x40);
++ STUFF_SM501_REG(SMIR_GPIO_32_63_CONTROL,
++ READ_SM501_REG(SMIR_GPIO_32_63_CONTROL)
++ & ~(GPBIT_MASK(I2C_CLK)|GPBIT_MASK(I2C_DATA))); // set as gpio controlled
++ udelay(LongBusWait);
++ ret = GetTime(lpst);
++ udelay(I2CWait);
++ SetDir_ClkData(INPUT,INPUT); //high clock, high data, just for safety, should be input already
++ if ((gate & 0x40)==0){
++ STUFF_SM501_REG( reg,
++ READ_SM501_REG( reg )
++ & ~0x40 ); //disable gpio if was originally
++ }
++
++ return ret;
++}
++int M41T81S_SetTime(LPSYSTEMTIME lpst)
++{
++ int ret;
++ int reg = (READ_SM501_REG(SMIR_POWER_MODE_CONTROL) & 1) ? SMIR_PWRM1_GATE : SMIR_PWRM0_GATE;
++ int gate = READ_SM501_REG(reg);
++ if ((gate & 0x40)==0) STUFF_SM501_REG(reg, gate | 0x40);
++ STUFF_SM501_REG(SMIR_GPIO_32_63_CONTROL,
++ READ_SM501_REG(SMIR_GPIO_32_63_CONTROL)
++ & ~(GPBIT_MASK(I2C_CLK)|GPBIT_MASK(I2C_DATA))); // set as gpio controlled
++ udelay(LongBusWait);
++ ret = SetTime(lpst);
++ udelay(I2CWait);
++ SetDir_ClkData(INPUT,INPUT); //high clock, high data, just for safety, should be input already
++ if ((gate & 0x40)==0){
++ STUFF_SM501_REG( reg,
++ READ_SM501_REG( reg )
++ & ~0x40 ); //disable gpio if was originally
++ }
++
++ return ret;
++}
++
++static int badTime( LPSYSTEMTIME lpst )
++{
++ return ( 1 > lpst->wMonth)
++ ||
++ ( 12 < lpst->wMonth)
++ ||
++ ( 1 > lpst->wDay)
++ ||
++ ( 12 < lpst->wDay)
++ ||
++ ( 24 <= lpst->wHour)
++ ||
++ ( 60 <= lpst->wMinute)
++ ||
++ ( 60 <= lpst->wSecond)
++ ||
++ ( 1000 <= lpst->wMilliseconds );
++}
++
++static unsigned diffMs( LPSYSTEMTIME lpst1,
++ LPSYSTEMTIME lpst2 )
++{
++ return ( (long)lpst2->wMilliseconds-(long)lpst1->wMilliseconds )
++ + ( (long)lpst2->wSecond-(long)lpst1->wSecond)*1000
++ + ( (long)lpst2->wMinute-(long)lpst1->wMinute)*60000
++ + ( (long)lpst2->wHour-(long)lpst1->wHour)*3600000 ;
++}
++
++static void printTime( LPSYSTEMTIME t )
++{
++ printf( "%04u-%02u-%02u %02u:%02u:%02u.%02u",
++ t->wYear, t->wMonth, t->wDay,
++ t->wHour, t->wMinute, t->wSecond, t->wMilliseconds/10 );
++}
++
++// returns zero for success
++static int parseTime( LPSYSTEMTIME t,
++ char const *dateString,
++ char const *timeString )
++{
++ int rval = 1 ;
++ char *nextIn ;
++ unsigned long inVal = simple_strtoul( dateString, &nextIn, 10 );
++ if( ( 0 == inVal ) || ( 2999 < inVal ) || ( '-' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wYear = inVal ;
++
++ inVal = simple_strtoul( nextIn, &nextIn, 10 );
++ if( ( 0 == inVal ) || ( 12 < inVal ) || ( '-' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wMonth = inVal ;
++
++ inVal = simple_strtoul( nextIn, &nextIn, 10 );
++ if( ( 0 == inVal ) || ( 31 < inVal ) || ( '\0' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wDay = inVal ;
++
++ t->wHour = 0 ; t->wMinute = 0 ; t->wSecond = 0 ; t->wMilliseconds = 0 ;
++
++ if( 0 != timeString )
++ {
++ inVal = simple_strtoul( timeString, &nextIn, 10 );
++ if( ( 23 < inVal ) || ( ':' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wHour = inVal ;
++
++ inVal = simple_strtoul( nextIn, &nextIn, 10 );
++ if( ( 59 < inVal ) || ( ':' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wMinute = inVal ;
++
++ inVal = simple_strtoul( nextIn, &nextIn, 10 );
++ if( ( 59 < inVal ) || ( '.' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wSecond = inVal ;
++
++ inVal = simple_strtoul( nextIn, &nextIn, 10 );
++ if( ( 99 < inVal ) || ( '\0' != *nextIn ) )
++ goto bail ;
++
++ nextIn++ ;
++ t->wMilliseconds = inVal*10 ;
++ rval = 0 ;
++ }
++ else
++ rval = 0 ;
++
++bail:
++ return rval ;
++}
++
++int do_rtc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ int rval = 1 ;
++
++ if( 1 == argc )
++ {
++ SYSTEMTIME t ;
++ int rval = M41T81S_GetTime( &t );
++ if( 0 == rval )
++ {
++ printTime(&t);
++ }
++ }
++ else if( ( 2 == argc ) && ( 0 == strcmp( "test", argv[1] ) ) )
++ {
++ SYSTEMTIME t ;
++ int rval = M41T81S_GetTime( &t );
++ if( 0 == rval ){
++ if( badTime(&t) ){
++ printf( "time not initialized...initializing\n" );
++ t.wYear = 2006 ;
++ t.wMonth = 6 ;
++ t.wDay = 3 ;
++ memset( &t, 0, sizeof(t) );
++ rval = M41T81S_SetTime(&t);
++ }
++ }
++
++ if( 0 == rval )
++ {
++ SYSTEMTIME t2 ;
++ udelay( 1000000 ); // wait a sec
++ rval = M41T81S_GetTime( &t2 );
++ if( 0 == rval )
++ {
++ unsigned diff = diffMs(&t,&t2);
++
++ if( ( diff < 800 ) || ( diff > 1200 ) )
++ {
++ rval = 1 ; // clock not moving or moving too fast (bad oscillator?)
++ if( 0 == diff )
++ printf( "check RTC oscillator\n" );
++#ifdef DEBUG
++ printf( "rtc test failed!\n"
++ "difftime: %u\n", diff );
++ printf( "t1: " ); printTime( &t ); printf( "\n" );
++ printf( "t2: " ); printTime( &t2 ); printf( "\n" );
++#endif
++ }
++ }
++ }
++ }
++ else if( ( 2 == argc ) || ( 3 == argc ) )
++ {
++ SYSTEMTIME t ;
++ if( 0 == parseTime( &t, argv[1], ( 3 == argc ) ? argv[2] : 0 ) )
++ {
++ rval = M41T81S_SetTime(&t);
++ }
++ else
++ printf( "Invalid time format: use YYYY-MM-DD HH:MM:SS\n" );
++ }
++
++ return rval ;
++}
++
++U_BOOT_CMD(
++ rtc, 127, 0, do_rtc,
++ "rtc - get/set/test RTC\n",
++ NULL
++);
++
++
+diff -u -r --new-file u-boot-1.1.2/board/neon/sm501.h u-boot-1.1.2-neon/board/neon/sm501.h
+--- u-boot-1.1.2/board/neon/sm501.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/sm501.h 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,22 @@
++#ifndef __SM501_H__
++#define __SM501_H__
++
++/*
++ * sm501.h
++ *
++ * Defines constants and macros for the SM-501 Graphics Controller.
++ *
++ */
++
++extern unsigned long const mmioStart ;
++extern unsigned long const mmioLength ;
++
++#define SMIR_GPIO_32_63_CONTROL 0x0000c
++#define SMIR_PWRM0_GATE 0x00040
++#define SMIR_PWRM1_GATE 0x00048
++#define SMIR_POWER_MODE_CONTROL 0x00054
++
++#define READ_SM501_REG( addr ) *( (unsigned long volatile *)((addr)+mmioStart) )
++#define STUFF_SM501_REG( addr, value ) *( (unsigned long volatile *)((addr)+mmioStart) ) = (value)
++
++#endif
+diff -u -r --new-file u-boot-1.1.2/board/neon/u-boot.lds u-boot-1.1.2-neon/board/neon/u-boot.lds
+--- u-boot-1.1.2/board/neon/u-boot.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/u-boot.lds 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(_start)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/start.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/board/neon/u-bootmini.lds u-boot-1.1.2-neon/board/neon/u-bootmini.lds
+--- u-boot-1.1.2/board/neon/u-bootmini.lds 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/board/neon/u-bootmini.lds 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,56 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
++OUTPUT_ARCH(arm)
++ENTRY(StartUp)
++SECTIONS
++{
++ . = 0x00000000;
++
++ . = ALIGN(4);
++ .text :
++ {
++ cpu/pxa/minidebug.o (.text)
++ cpu/pxa/ministart.o (.text)
++ *(.text)
++ }
++
++ . = ALIGN(4);
++ .rodata : { *(.rodata) }
++
++ . = ALIGN(4);
++ .data : { *(.data) }
++
++ . = ALIGN(4);
++ .got : { *(.got) }
++
++ __u_boot_cmd_start = .;
++ .u_boot_cmd : { *(.u_boot_cmd) }
++ __u_boot_cmd_end = .;
++
++ . = ALIGN(4);
++ __bss_start = .;
++ .bss : { *(.bss) }
++ _end = .;
++}
+diff -u -r --new-file u-boot-1.1.2/common/cmd_boot.c u-boot-1.1.2-neon/common/cmd_boot.c
+--- u-boot-1.1.2/common/cmd_boot.c 2003-10-09 01:26:14.000000000 +0200
++++ u-boot-1.1.2-neon/common/cmd_boot.c 2007-08-11 21:07:20.000000000 +0200
+@@ -59,6 +59,7 @@
+ */
+ argv[0] = (char *)gd;
+ #endif
++ *((ulong*)0x40e00014) |= (1<<25); //make gpio89 an output(ac97_reset)
+ #if !defined(CONFIG_NIOS)
+ rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
+ #else
+diff -u -r --new-file u-boot-1.1.2/common/cmd_bootm.c u-boot-1.1.2-neon/common/cmd_bootm.c
+--- u-boot-1.1.2/common/cmd_bootm.c 2004-11-21 01:06:34.000000000 +0100
++++ u-boot-1.1.2-neon/common/cmd_bootm.c 2007-08-11 21:07:20.000000000 +0200
+@@ -29,8 +29,6 @@
+ #include <command.h>
+ #include <image.h>
+ #include <malloc.h>
+-#include <zlib.h>
+-#include <bzlib.h>
+ #include <environment.h>
+ #include <asm/byteorder.h>
+
+@@ -73,10 +71,12 @@
+ # define CHUNKSZ (64 * 1024)
+ #endif
+
++#ifdef CONFIG_GZIP
++#include <zlib.h>
+ int gunzip (void *, int, unsigned char *, unsigned long *);
+-
+ static void *zalloc(void *, unsigned, unsigned);
+ static void zfree(void *, void *, unsigned);
++#endif
+
+ #if (CONFIG_COMMANDS & CFG_CMD_IMI)
+ static int image_info (unsigned long addr);
+@@ -327,12 +327,17 @@
+ break;
+ case IH_COMP_GZIP:
+ printf (" Uncompressing %s ... ", name);
++#ifdef CONFIG_GZIP
+ if (gunzip ((void *)ntohl(hdr->ih_load), unc_len,
+ (uchar *)data, &len) != 0) {
+ puts ("GUNZIP ERROR - must RESET board to recover\n");
+ SHOW_BOOT_PROGRESS (-6);
+ do_reset (cmdtp, flag, argc, argv);
+ }
++#else
++ printf( "GUNZIP not supported\n" );
++#endif
++
+ break;
+ #ifdef CONFIG_BZIP2
+ case IH_COMP_BZIP2:
+@@ -1221,6 +1226,8 @@
+ printf ("%s %s %s (%s)", arch, os, type, comp);
+ }
+
++#ifdef CONFIG_GZIP
++
+ #define ZALLOC_ALIGNMENT 16
+
+ static void *zalloc(void *x, unsigned items, unsigned size)
+@@ -1302,6 +1309,8 @@
+
+ return (0);
+ }
++#endif // CONFIG_GZIP
++
+
+ #ifdef CONFIG_BZIP2
+ void bz_internal_error(int errcode)
+diff -u -r --new-file u-boot-1.1.2/common/cmd_fat.c u-boot-1.1.2-neon/common/cmd_fat.c
+--- u-boot-1.1.2/common/cmd_fat.c 2004-08-28 23:09:15.000000000 +0200
++++ u-boot-1.1.2-neon/common/cmd_fat.c 2007-08-11 21:07:20.000000000 +0200
+@@ -30,6 +30,13 @@
+ #include <net.h>
+ #include <ata.h>
+
++#define CONFIG_FATLOAD_TICKS
++#define CONFIG_FATLOAD_ADLER
++
++#ifdef CONFIG_FATLOAD_ADLER
++#include <zlib.h>
++#endif
++
+ #if (CONFIG_COMMANDS & CFG_CMD_FAT)
+
+ #undef DEBUG
+@@ -83,6 +90,11 @@
+ int dev=0;
+ int part=1;
+ char *ep;
++#ifdef CONFIG_FATLOAD_TICKS
++ ulong ticks1 ;
++ ulong ticks2 ;
++ ulong ticks3 ;
++#endif
+
+ if (argc < 5) {
+ printf ("usage: fatload <interface> <dev[:part]> <addr> <filename> [bytes]\n");
+@@ -110,6 +122,10 @@
+ count = simple_strtoul (argv[5], NULL, 16);
+ else
+ count = 0;
++#ifdef CONFIG_FATLOAD_TICKS
++ ticks1 = get_timer( 0 );
++#endif
++
+ size = file_fat_read (argv[4], (unsigned char *) offset, count);
+
+ if(size==-1) {
+@@ -117,7 +133,21 @@
+ return 1;
+ }
+
+- printf ("\n%ld bytes read\n", size);
++ printf ("\n%ld bytes read", size);
++
++#ifdef CONFIG_FATLOAD_TICKS
++ ticks2 = get_timer( 0 );
++ printf( " in %lu ticks, (%lu ms)", (ticks2-ticks1), (ticks2-ticks1)/(CFG_HZ/1000) );
++#endif
++
++#ifdef CONFIG_FATLOAD_ADLER
++ printf( ", adler == 0x" );
++ printf( "%08lx", adler32(0, (Bytef *)offset, size ) );
++ ticks3 = get_timer( 0 );
++ printf( " in %lu ticks, (%lu ms)", (ticks3-ticks2), (ticks3-ticks2)/(CFG_HZ/1000) );
++#endif
++
++ printf( "\n" );
+
+ sprintf(buf, "%lX", size);
+ setenv("filesize", buf);
+diff -u -r --new-file u-boot-1.1.2/common/cmd_flash.c u-boot-1.1.2-neon/common/cmd_flash.c
+--- u-boot-1.1.2/common/cmd_flash.c 2004-12-31 10:32:50.000000000 +0100
++++ u-boot-1.1.2-neon/common/cmd_flash.c 2007-08-11 21:07:20.000000000 +0200
+@@ -507,7 +507,7 @@
+ );
+
+ U_BOOT_CMD(
+- erase, 3, 1, do_flerase,
++ erase, 3, 0, do_flerase,
+ "erase - erase FLASH memory\n",
+ "start end\n"
+ " - erase FLASH from addr 'start' to addr 'end'\n"
+diff -u -r --new-file u-boot-1.1.2/common/cmd_lcdpanel.c u-boot-1.1.2-neon/common/cmd_lcdpanel.c
+--- u-boot-1.1.2/common/cmd_lcdpanel.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/cmd_lcdpanel.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,265 @@
++/*
++ * Module cmd_lcdpanel.cpp
++ *
++ * This module defines ...
++ *
++ *
++ * Change History :
++ *
++ * $Log: cmd_lcdpanel.c,v $
++ * Revision 1.8 2005/09/19 13:15:59 ericn
++ * -allow zeros in most fields
++ *
++ * Revision 1.7 2005/08/22 16:30:32 ericn
++ * -update panel env var w/lcdp command
++ *
++ * Revision 1.6 2005/07/18 03:05:53 ericn
++ * -allow cmdline config of CRT
++ *
++ * Revision 1.5 2005/07/06 05:26:54 ericn
++ * -make lcdinfo command conditional on PXALCD
++ *
++ * Revision 1.4 2005/07/04 18:49:01 ericn
++ * -added lcdi command
++ *
++ * Revision 1.3 2005/06/02 04:01:30 ericn
++ * -allow zero value of pixclock (meaning slow one)
++ *
++ * Revision 1.2 2005/04/30 20:32:44 ericn
++ * -added disable cmd
++ *
++ * Revision 1.1 2005/04/09 17:49:15 ericn
++ * -Initial import
++ *
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ *
++ * 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
++ */
++
++
++#include <common.h>
++#include <command.h>
++#if (CONFIG_COMMANDS & CFG_CMD_LCDPANEL)
++
++#include <malloc.h>
++#include <lcd_panels.h>
++
++extern char console_buffer[]; /* console I/O buffer */
++
++static void print_panel_info( struct lcd_panel_info_t const *panel )
++{
++ printf( "------------------------------------\n"
++ "name : %s\n", panel->name );
++ printf( "pixclock : %u\n", panel->pixclock );
++ printf( "xres : %u\n", panel->xres );
++ printf( "yres : %u\n", panel->yres );
++ printf( "act_high : %u\n", panel->act_high );
++ printf( "hsync_len : %u\n", panel->hsync_len );
++ printf( "left_margin : %u\n", panel->left_margin );
++ printf( "right_margin : %u\n", panel->right_margin );
++ printf( "vsync_len : %u\n", panel->vsync_len );
++ printf( "upper_margin : %u\n", panel->upper_margin );
++ printf( "lower_margin : %u\n", panel->lower_margin );
++ printf( "active : %u\n", panel->active );
++ printf( "CRT ? %u\n", panel->crt );
++}
++
++static struct lcd_panel_info_t const *prompt_for_panel( void )
++{
++ struct lcd_panel_info_t *panel = (struct lcd_panel_info_t *)malloc(sizeof(struct lcd_panel_info_t));
++ int bytesRead ;
++
++ memset( panel, 0, sizeof(*panel));
++
++ bytesRead = readline( "name: " );
++ if( 0 < bytesRead )
++ {
++ panel->name = strdup( console_buffer );
++ bytesRead = readline( "pixclock: " );
++ if( 0 < bytesRead )
++ {
++ char *endp;
++ ulong value = simple_strtoul( console_buffer, &endp, 0 );
++ if( endp > console_buffer )
++ {
++ panel->pixclock = value ;
++ bytesRead = readline( "xres: " );
++ if( ( 0 < bytesRead )
++ && ( 0 != ( value = simple_strtoul( console_buffer, &endp, 0 ) ) )
++ && ( endp > console_buffer ) )
++ {
++ panel->xres = value ;
++ bytesRead = readline( "yres: " );
++ if( ( 0 < bytesRead )
++ && ( 0 != ( value = simple_strtoul( console_buffer, &endp, 0 ) ) )
++ && ( endp > console_buffer ) )
++ {
++ panel->yres = value ;
++ bytesRead = readline( "act_high: " );
++ if( ( 0 < bytesRead )
++ && ( 1 >= ( value = simple_strtoul( console_buffer, &endp, 0 ) ) )
++ && ( endp > console_buffer ) )
++ {
++ panel->act_high = value ;
++ bytesRead = readline( "hsync_len: " );
++ if( ( 0 < bytesRead )
++ && ( 0 != ( value = simple_strtoul( console_buffer, &endp, 0 ) ) )
++ && ( endp > console_buffer ) )
++ {
++ panel->hsync_len = value ;
++ bytesRead = readline( "left_margin: " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ && ( endp > console_buffer ) )
++ {
++ panel->left_margin = value ;
++ bytesRead = readline( "right_margin: " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ && ( endp > console_buffer ) )
++ {
++ panel->right_margin = value ;
++ bytesRead = readline( "vsync_len: " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ && ( endp > console_buffer ) )
++ {
++ panel->vsync_len = value ;
++ bytesRead = readline( "upper_margin: " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ && ( endp > console_buffer ) )
++ {
++ panel->upper_margin = value ;
++ bytesRead = readline( "lower_margin: " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ && ( endp > console_buffer ) )
++ {
++ panel->lower_margin = value ;
++ bytesRead = readline( "active (0|1) : " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead ) && ( endp > console_buffer ) )
++ {
++ panel->active = value ;
++ bytesRead = readline( "crt (0|1) : " );
++ value = simple_strtoul( console_buffer, &endp, 0 );
++ if( ( 0 < bytesRead )
++ &&
++ ( endp > console_buffer ) )
++ {
++ panel->crt = value ;
++ print_panel_info( panel );
++ return panel ;
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++
++ free( panel );
++
++ return 0 ;
++}
++
++static int lcdpanel(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ if ( 1 == argc ) {
++ if( cur_lcd_panel )
++ print_panel_info( cur_lcd_panel );
++ else
++ printf( "no panel defined\n" );
++ }
++ else {
++ struct lcd_panel_info_t const *panel = find_lcd_panel( argv[1] );
++ if( panel ) {
++ printf( "found panel %s\n", panel->name );
++ set_lcd_panel( panel );
++ setenv( "panel", panel->name );
++ }
++ else if( '+' == *argv[1] ) {
++ panel = prompt_for_panel();
++ if( panel )
++ {
++ print_panel_info( panel );
++ set_lcd_panel( panel );
++ }
++ }
++ else if( '?' == *argv[1] )
++ {
++ int i ;
++ for( i = 0 ; i < num_lcd_panels ; i++ )
++ print_panel_info( lcd_panels+i );
++ }
++ else if( '-' == *argv[1] )
++ {
++ disable_lcd_panel();
++ printf( "panel disabled\n" );
++ }
++ else
++ printf( "panel %s not found\n", argv[1] );
++ }
++
++ return 0;
++}
++
++
++U_BOOT_CMD(
++ lcdpanel, 2, 0, lcdpanel,
++ "lcdpanel [panelName|?|+|-]\n"
++ " init lcd panel with panel name\n"
++ " ? will display the supported panels\n"
++ " + will prompt for panel details\n"
++ " - will disable the panel\n",
++ NULL
++);
++
++#ifdef PXALCD
++#include <lcd.h>
++
++static int lcdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ printf( "--> lcdinfo:\n"
++ "screen: %08lx\n"
++ "palette: %08lx/%u\n",
++ panel_info.pxa.screen,
++ panel_info.pxa.palette,
++ panel_info.pxa.palette_size );
++ return 0 ;
++}
++
++U_BOOT_CMD(
++ lcdinfo, 2, 0, lcdinfo,
++ "lcdinfo\n",
++ NULL
++);
++#endif
++
++#endif /* CFG_CMD_LCDPANEL */
++
++
++
++
+diff -u -r --new-file u-boot-1.1.2/common/cmd_lcdpanel.h u-boot-1.1.2-neon/common/cmd_lcdpanel.h
+--- u-boot-1.1.2/common/cmd_lcdpanel.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/cmd_lcdpanel.h 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,24 @@
++#ifndef __CMD_LCDPANEL_H__
++#define __CMD_LCDPANEL_H__ "$Id: cmd_lcdpanel.h,v 1.1 2005/04/09 17:49:16 ericn Exp $"
++
++/*
++ * cmd_lcdpanel.h
++ *
++ * This header file declares ...
++ *
++ *
++ * Change History :
++ *
++ * $Log: cmd_lcdpanel.h,v $
++ * Revision 1.1 2005/04/09 17:49:16 ericn
++ * -Initial import
++ *
++ *
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++
++
++#endif
++
+diff -u -r --new-file u-boot-1.1.2/common/cmd_mmc.c u-boot-1.1.2-neon/common/cmd_mmc.c
+--- u-boot-1.1.2/common/cmd_mmc.c 2003-07-01 23:07:07.000000000 +0200
++++ u-boot-1.1.2-neon/common/cmd_mmc.c 2007-08-11 21:07:20.000000000 +0200
+@@ -43,4 +43,71 @@
+ NULL
+ );
+
++int do_mmc_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ if( 5 == argc )
++ {
++ unsigned long args[4];
++ unsigned i ;
++ for( i = 1 ; i < 5 ; i++ )
++ {
++ char *endp ;
++ args[i-1] = simple_strtoul(argv[i], &endp, 16 );
++ if( 0 != *endp )
++ {
++ printf( "arg[%u] is not a valid hex number\n", i );
++ break;
++ }
++ }
++
++ if( 5 == i )
++ {
++ uchar *resp = mmc_cmd( (ushort)args[0],
++ (ushort)args[1],
++ (ushort)args[2],
++ (ushort)args[3] );
++ ushort numWords = 0 ;
++ switch( args[3] )
++ {
++ case MMC_CMDAT_R1:
++ case MMC_CMDAT_R3:
++ numWords = 3;
++ break;
++
++ case MMC_CMDAT_R2:
++ numWords = 8;
++ break;
++
++ default:
++ printf( "Invalid response type %lu, options are [1,2,3]\n", args[3] );
++ break;
++ }
++
++ if( resp )
++ {
++ for( i = 0 ; i < numWords*2 ; i++ )
++ {
++ printf( "%02X ", resp[i] );
++ }
++ printf( "\n" );
++ }
++ else
++ printf( "no response\n" );
++ }
++ }
++ else
++ printf ("Usage:\n%s\n", cmdtp->usage);
++
++ return 0;
++}
++
++extern uchar *
++mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat);
++
++U_BOOT_CMD(
++ mmccmd, 5, 0, do_mmc_cmd,
++ "mmccmd - issue mmc command\n",
++ "mmccmd cmd# argh(hex) argl(hex) rsptype\n"
++);
++
+ #endif /* CFG_CMD_MMC */
+diff -u -r --new-file u-boot-1.1.2/common/cmd_net.c u-boot-1.1.2-neon/common/cmd_net.c
+--- u-boot-1.1.2/common/cmd_net.c 2004-06-09 14:42:26.000000000 +0200
++++ u-boot-1.1.2-neon/common/cmd_net.c 2007-08-11 21:07:20.000000000 +0200
+@@ -46,6 +46,104 @@
+ "[loadAddress] [bootfilename]\n"
+ );
+
++extern int get_rom_mac (char *v_rom_mac);
++extern int set_rom_mac (char const *v_rom_mac);
++
++/*
++ * returns -1 if not valid hex
++ */
++static int hexValue( char c )
++{
++ if( ( '0' <= c ) && ( '9' >= c ) )
++ {
++ return c-'0' ;
++ }
++ else if( ( 'A' <= c ) && ( 'F' >= c ) )
++ {
++ return c-'A'+10 ;
++ }
++ else if( ( 'a' <= c ) && ( 'f' >= c ) )
++ {
++ return c-'a'+10 ;
++ }
++ else
++ return -1 ;
++}
++
++// returns non-zero to indicate success
++static int parse_mac( char const *macString, // input
++ char *macaddr ) // output: not NULL-terminated
++{
++ int i ;
++ for( i = 0 ; i < 6 ; i++ )
++ {
++ char high, low, term ;
++ int highval, lowval ;
++ high = *macString++ ;
++
++ if( ( 0 == high )
++ ||
++ ( 0 > ( highval = hexValue(high) ) ) )
++ break ;
++ low = *macString++ ;
++ if( ( 0 == low )
++ ||
++ ( 0 > ( lowval = hexValue(low) ) ) )
++ break ;
++
++ term = *macString++ ;
++ if( 5 > i )
++ {
++ if( ( '-' != term ) && ( ':' != term ) )
++ break ;
++ }
++ else if( '\0' != term )
++ break ;
++
++ *macaddr++ = (highval<<4) | lowval ;
++ }
++
++ return ( 6 == i );
++}
++
++int do_mac (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ if( 2 == argc )
++ {
++ char mac[6];
++ if( parse_mac( argv[1], mac ) )
++ {
++ printf( "setting mac address to %02x:%02x:%02x:%02x:%02x:%02x\n",
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5] );
++ if( set_rom_mac( mac ) )
++ printf( "done\n" );
++ else
++ printf( "Error setting mac address\n" );
++ }
++ else
++ printf( "Error parsing mac: use form NN:NN:NN:NN:NN:NN\n" );
++ }
++ else
++ {
++ char mac[6];
++ if( get_rom_mac( mac ) )
++ printf( "mac address %02x:%02x:%02x:%02x:%02x:%02x\n",
++ mac[0],mac[1],mac[2],mac[3],mac[4],mac[5] );
++ else if( 0xFF == mac[0] )
++ printf( "MAC has not been programmed\n" );
++ else
++ printf( "error reading mac\n" );
++ }
++ return 0 ;
++}
++
++U_BOOT_CMD(
++ mac, 3, 1, do_mac,
++ "mac\t- read/write mac address\n",
++ "- supply a parameter of the form NN:NN:NN:NN:NN:NN to set"
++);
++
++
+ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+ {
+ return netboot_common (TFTP, cmdtp, argc, argv);
+diff -u -r --new-file u-boot-1.1.2/common/cmd_not.c u-boot-1.1.2-neon/common/cmd_not.c
+--- u-boot-1.1.2/common/cmd_not.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/cmd_not.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,55 @@
++/*
++ * (C) Copyright 2006
++ * Eric Nelson, Boundary Devices
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <common.h>
++#include <config.h>
++#include <command.h>
++
++#if (CONFIG_COMMANDS & CFG_CMD_NOT)
++
++int do_not (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ int rval = 1 ;
++ if( 1 < argc )
++ {
++ cmd_tbl_t *cmd = find_cmd(argv[1]);
++ if( cmd )
++ {
++ rval = ( 0 == cmd->cmd(cmd, flag, argc-1, argv+1) );
++ }
++ else
++ printf( "command %s not found\n", argv[1] );
++ }
++ else
++ printf( "Usage not command [..params]\n" );
++
++ return rval ;
++}
++
++U_BOOT_CMD(
++ not, 127, 0, do_not,
++ "not - negate a command\n",
++ NULL
++);
++
++#endif /* CONFIG_COMMANDS & CFG_CMD_NOT */
+diff -u -r --new-file u-boot-1.1.2/common/cmd_nvedit.c u-boot-1.1.2-neon/common/cmd_nvedit.c
+--- u-boot-1.1.2/common/cmd_nvedit.c 2004-09-30 00:55:14.000000000 +0200
++++ u-boot-1.1.2-neon/common/cmd_nvedit.c 2007-08-11 21:07:20.000000000 +0200
+@@ -487,16 +487,21 @@
+ {
+ int i, nxt;
+
++// printf ("before WATCHDOG_RESET\n");
+ WATCHDOG_RESET();
++// printf ("after WATCHDOG_RESET\n");
+
+ for (i=0; env_get_char(i) != '\0'; i=nxt+1) {
+ int val;
+
++// printf ("i= %i\n", i);
+ for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) {
+ if (nxt >= CFG_ENV_SIZE) {
+ return (NULL);
+ }
++// putc(env_get_char(nxt));
+ }
++// printf ("\n");
+ if ((val=envmatch(name, i)) < 0)
+ continue;
+ return (env_get_addr(val));
+diff -u -r --new-file u-boot-1.1.2/common/command.c u-boot-1.1.2-neon/common/command.c
+--- u-boot-1.1.2/common/command.c 2004-04-18 19:39:39.000000000 +0200
++++ u-boot-1.1.2-neon/common/command.c 2007-08-11 21:07:20.000000000 +0200
+@@ -27,6 +27,9 @@
+
+ #include <common.h>
+ #include <command.h>
++#ifdef CONFIG_LCD
++#include "lcd.h"
++#endif
+
+ int
+ do_version (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+@@ -74,6 +77,41 @@
+ " - echo args to console; \\c suppresses newline\n"
+ );
+
++#ifdef CONFIG_LCD
++
++int
++do_lecho (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ int i, putnl = 1;
++
++ for (i = 1; i < argc; i++) {
++ char *p = argv[i], c;
++
++ if (i > 1)
++ putc(' ');
++ while ((c = *p++) != '\0') {
++ if (c == '\\' && *p == 'c') {
++ putnl = 0;
++ p++;
++ } else {
++ lcd_putc(c);
++ }
++ }
++ }
++
++ if (putnl)
++ lcd_putc('\n');
++ return 0;
++}
++
++U_BOOT_CMD(
++ lecho, CFG_MAXARGS, 1, do_lecho,
++ "lecho - echo args to lcd\n",
++ "[args..]\n"
++ " - echo args to lcd; \\c suppresses newline\n"
++);
++#endif
++
+ #ifdef CFG_HUSH_PARSER
+
+ int
+diff -u -r --new-file u-boot-1.1.2/common/env_flash.c u-boot-1.1.2-neon/common/env_flash.c
+--- u-boot-1.1.2/common/env_flash.c 2004-03-14 02:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/env_flash.c 2007-08-11 21:07:20.000000000 +0200
+@@ -83,6 +83,10 @@
+ #define OBSOLETE_FLAG 0
+ #endif /* CFG_ENV_ADDR_REDUND */
+
++#ifdef CFG_ENV_IS_IN_FLASH
++static env_t *flash_addr_new = (env_t *)CFG_ENV_ADDR ;
++#endif
++
+ extern uchar default_environment[];
+ extern int default_environment_size;
+
+diff -u -r --new-file u-boot-1.1.2/common/fnmatch.c u-boot-1.1.2-neon/common/fnmatch.c
+--- u-boot-1.1.2/common/fnmatch.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/fnmatch.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,166 @@
++/*
++ * (C) Copyright 2005
++ * Boundary Devices
++ *
++ * 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
++ *
++ */
++
++#include <common.h>
++#include <config.h>
++#include <part.h>
++
++/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
++ #defined, it maps the character C onto its "canonical" form. In a
++ case-insensitive system, it would map all alphanumeric characters
++ to lower case. Under Windows NT, / and \ are both path component
++ separators, so FOLD_FN_CHAR would map them both to /. */
++#define FOLD_FN_CHAR(c) (c)
++
++
++int fnmatch(const char *pattern, const char *string, int flags)
++{
++ register const char *p = pattern, *n = string;
++ register char c;
++
++ while ((c = *p++) != '\0')
++ {
++ switch (c)
++ {
++ case '?':
++ if (*n == '\0')
++ return FNM_NOMATCH;
++ else if ((flags & FNM_PATHNAME) && *n == '/')
++ return FNM_NOMATCH;
++ else if ((flags & FNM_PERIOD) && *n == '.' &&
++ (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
++ return FNM_NOMATCH;
++ break;
++
++ case '\\':
++ if (!(flags & FNM_NOESCAPE))
++ c = *p++;
++ if (FOLD_FN_CHAR (*n) != FOLD_FN_CHAR (c))
++ return FNM_NOMATCH;
++ break;
++
++ case '*':
++ if ((flags & FNM_PERIOD) && *n == '.' &&
++ (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
++ return FNM_NOMATCH;
++
++ for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
++ if (((flags & FNM_PATHNAME) && *n == '/') ||
++ (c == '?' && *n == '\0'))
++ return FNM_NOMATCH;
++
++ if (c == '\0')
++ return 0;
++
++ {
++ char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
++ for (--p; *n != '\0'; ++n)
++ if ((c == '[' || FOLD_FN_CHAR (*n) == FOLD_FN_CHAR (c1)) &&
++ fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
++ return 0;
++ return FNM_NOMATCH;
++ }
++
++ case '[':
++ {
++ /* Nonzero if the sense of the character class is inverted. */
++ register int not;
++
++ if (*n == '\0')
++ return FNM_NOMATCH;
++
++ if ((flags & FNM_PERIOD) && *n == '.' &&
++ (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
++ return FNM_NOMATCH;
++
++ not = (*p == '!' || *p == '^');
++ if (not)
++ ++p;
++
++ c = *p++;
++ for (;;)
++ {
++ register char cstart = c, cend = c;
++
++ if (!(flags & FNM_NOESCAPE) && c == '\\')
++ cstart = cend = *p++;
++
++ if (c == '\0')
++ /* [ (unterminated) loses. */
++ return FNM_NOMATCH;
++
++ c = *p++;
++
++ if ((flags & FNM_PATHNAME) && c == '/')
++ /* [/] can never match. */
++ return FNM_NOMATCH;
++
++ if (c == '-' && *p != ']')
++ {
++ cend = *p++;
++ if (!(flags & FNM_NOESCAPE) && cend == '\\')
++ cend = *p++;
++ if (cend == '\0')
++ return FNM_NOMATCH;
++ c = *p++;
++ }
++
++ if (*n >= cstart && *n <= cend)
++ goto matched;
++
++ if (c == ']')
++ break;
++ }
++ if (!not)
++ return FNM_NOMATCH;
++ break;
++
++ matched:;
++ /* Skip the rest of the [...] that already matched. */
++ while (c != ']')
++ {
++ if (c == '\0')
++ /* [... (unterminated) loses. */
++ return FNM_NOMATCH;
++
++ c = *p++;
++ if (!(flags & FNM_NOESCAPE) && c == '\\')
++ /* 1003.2d11 is unclear if this is right. %%% */
++ ++p;
++ }
++ if (not)
++ return FNM_NOMATCH;
++ }
++ break;
++
++ default:
++ if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
++ return FNM_NOMATCH;
++ }
++
++ ++n;
++ }
++
++ if (*n == '\0')
++ return 0;
++
++ return FNM_NOMATCH;
++}
++
+diff -u -r --new-file u-boot-1.1.2/common/lcd.c u-boot-1.1.2-neon/common/lcd.c
+--- u-boot-1.1.2/common/lcd.c 2004-12-10 12:40:50.000000000 +0100
++++ u-boot-1.1.2-neon/common/lcd.c 2007-08-11 21:07:20.000000000 +0200
+@@ -41,7 +41,7 @@
+ #endif
+ #include <lcd.h>
+
+-#if defined(CONFIG_PXA250)
++#if defined(CONFIG_PXA250) || defined(CONFIG_PXA270)
+ #include <asm/byteorder.h>
+ #endif
+
+@@ -94,8 +94,46 @@
+ static int lcd_getfgcolor (void);
+ #endif /* NOT_USED_SO_FAR */
+
+-/************************************************************************/
++static int luminance( int red, int green, int blue )
++{
++ //
++ // I've seen a couple of different algorithms here:
++ // (max+min)/2
++/*
++
++ int max = MAX( red, MAX( green, blue ) );
++ int min = MIN( red, MIN( green, blue ) );
++ return (max+min)/2 ;
++*/
++
++ // A more mathematically-correct version
++// return (int)(c.R*0.3 + c.G*0.59+ c.B*0.11);
++
++ // Just return 'green'
++ // return green;
++
++ // and one that uses shifts and adds to come close to the above
++ //
++ // red = 5/16= 0.3125 == 1/4 + 1/16
++ // green = 9/16= 0.5625 == 1/2 + 1/16
++ // blue = 1/8 = 0.125
++ //
++ if( 0 < red )
++ red = (red>>2) + (red>>4);
++ else
++ red = 0 ;
++ if( 0 < green )
++ green = (green>>1) + (green>>4) ;
++ else
++ green = 0 ;
++ if( 0 < blue )
++ blue = blue >> 3 ;
++ else
++ blue = 0 ;
++ return red+green+blue ;
++}
+
++/************************************************************************/
+ /*----------------------------------------------------------------------*/
+
+ static void console_scrollup (void)
+@@ -221,10 +259,10 @@
+ uchar *dest;
+ ushort off, row;
+
+- dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1 << LCD_BPP) / 8);
++ dest = (uchar *)(lcd_base + y * panel_info.vl_lcd_line_length + x * (1 << LCD_BPP) / 8);
+ off = x * (1 << LCD_BPP) % 8;
+
+- for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
++ for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += panel_info.vl_lcd_line_length) {
+ uchar *s = str;
+ uchar *d = dest;
+ int i;
+@@ -337,8 +375,6 @@
+
+ lcd_base = (void *)(gd->fb_base);
+
+- lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;
+-
+ lcd_init (lcd_base); /* LCD initialization */
+
+ /* Device initialization */
+@@ -389,7 +425,7 @@
+ /* set framebuffer to background color */
+ memset ((char *)lcd_base,
+ COLOR_MASK(lcd_getbgcolor()),
+- lcd_line_length*panel_info.vl_row);
++ panel_info.vl_lcd_line_length*panel_info.vl_row);
+ #endif
+ /* Paint the logo and retrieve LCD base address */
+ debug ("[LCD] Drawing the logo...\n");
+@@ -500,12 +536,13 @@
+ #ifdef CONFIG_LCD_LOGO
+ void bitmap_plot (int x, int y)
+ {
+- ushort *cmap;
++ PALETTEVAL_TYPE *cmap;
+ ushort i, j;
+ uchar *bmap;
+ uchar *fb;
+ ushort *fb16;
+-#if defined(CONFIG_PXA250)
++
++#if defined(PXALCD)
+ struct pxafb_info *fbi = &panel_info.pxa;
+ #elif defined(CONFIG_MPC823)
+ volatile immap_t *immr = (immap_t *) CFG_IMMR;
+@@ -514,17 +551,18 @@
+
+ debug ("Logo: width %d height %d colors %d cmap %d\n",
+ BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
+- sizeof(bmp_logo_palette)/(sizeof(ushort)));
++ sizeof(bmp_logo_palette)/(sizeof(PALETTEVAL_TYPE)));
+
+ bmap = &bmp_logo_bitmap[0];
+- fb = (char *)(lcd_base + y * lcd_line_length + x);
++ fb = (char *)(lcd_base + y * panel_info.vl_lcd_line_length + x);
+
+ if (NBITS(panel_info.vl_bpix) < 12) {
+ /* Leave room for default color map */
+-#if defined(CONFIG_PXA250)
+- cmap = (ushort *)fbi->palette;
++#if defined(PXALCD)
++ cmap = (PALETTEVAL_TYPE *)fbi->palette;
+ #elif defined(CONFIG_MPC823)
+ cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);
++#elif defined(CONFIG_SM501)
+ #endif
+
+ WATCHDOG_RESET();
+@@ -532,10 +570,13 @@
+ /* Set color map */
+ for (i=0; i<(sizeof(bmp_logo_palette)/(sizeof(ushort))); ++i) {
+ ushort colreg = bmp_logo_palette[i];
+-#ifdef CFG_INVERT_COLORS
+- *cmap++ = 0xffff - colreg;
++#if defined(CONFIG_SM501)
+ #else
++ #ifdef CFG_INVERT_COLORS
++ *cmap++ = 0xffff - colreg;
++ #else
+ *cmap++ = colreg;
++ #endif
+ #endif
+ }
+
+@@ -548,7 +589,7 @@
+ }
+ }
+ else { /* true color mode */
+- fb16 = (ushort *)(lcd_base + y * lcd_line_length + x);
++ fb16 = (ushort *)(lcd_base + y * panel_info.vl_lcd_line_length + x);
+ for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
+ for (j=0; j<BMP_LOGO_WIDTH; j++) {
+ fb16[j] = bmp_logo_palette[(bmap[j])];
+@@ -570,7 +611,11 @@
+ */
+ int lcd_display_bitmap(ulong bmp_image, int x, int y)
+ {
+- ushort *cmap;
++#if defined(CONFIG_SM501)
++ uchar *cmap ;
++#else
++ PALETTEVAL_TYPE *cmap;
++#endif
+ ushort i, j;
+ uchar *fb;
+ bmp_image_t *bmp=(bmp_image_t *)bmp_image;
+@@ -579,7 +624,12 @@
+ unsigned long width, height;
+ unsigned colors,bpix;
+ unsigned long compression;
+-#if defined(CONFIG_PXA250)
++ int maxLum = 0 ;
++ int bgCol = 0 ;
++ int minLum = 0xFFFF ;
++ int fgCol = 0 ;
++
++#if defined(PXALCD)
+ struct pxafb_info *fbi = &panel_info.pxa;
+ #elif defined(CONFIG_MPC823)
+ volatile immap_t *immr = (immap_t *) CFG_IMMR;
+@@ -590,7 +640,7 @@
+ (bmp->header.signature[1]=='M'))) {
+ printf ("Error: no valid bmp image at %lx\n", bmp_image);
+ return 1;
+-}
++ }
+
+ width = le32_to_cpu (bmp->header.width);
+ height = le32_to_cpu (bmp->header.height);
+@@ -616,33 +666,64 @@
+ (int)width, (int)height, (int)colors);
+
+ if (bpix==8) {
+-#if defined(CONFIG_PXA250)
+- cmap = (ushort *)fbi->palette;
++#if defined(PXALCD)
++ cmap = (PALETTEVAL_TYPE *)fbi->palette;
+ #elif defined(CONFIG_MPC823)
+ cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
++#elif defined(CONFIG_SM501)
++ cmap = (uchar *)paletteRegs ;
+ #else
+ # error "Don't know location of color map"
+ #endif
+
+ /* Set color map */
+ for (i=0; i<colors; ++i) {
++ int lum ;
+ bmp_color_table_entry_t cte = bmp->color_table[i];
++#if defined(CONFIG_SM501)
++ *cmap++ = cte.blue ;
++ *cmap++ = cte.green ;
++ *cmap++ = cte.red ;
++ *cmap++ = 0 ;
++#elif defined(CONFIG_PXA270) && defined(PXALCD)
++ *cmap = 0xFF000000 ;
++ *cmap |= cte.red << 16 ;
++ *cmap |= cte.green << 8 ;
++ *cmap |= cte.blue ;
++ *cmap++ ;
++#else
+ ushort colreg =
+ ( ((cte.red) << 8) & 0xf800) |
+ ( ((cte.green) << 4) & 0x07e0) |
+ ( (cte.blue) & 0x001f) ;
+-
+-#ifdef CFG_INVERT_COLORS
++ #ifdef CFG_INVERT_COLORS
+ *cmap = 0xffff - colreg;
+-#else
++ #else
+ *cmap = colreg;
+-#endif
+-#if defined(CONFIG_PXA250)
++ #endif
++ #if defined(PXALCD)
+ cmap++;
+-#elif defined(CONFIG_MPC823)
++ #elif defined(CONFIG_MPC823)
+ cmap--;
++ #endif
+ #endif
++ lum = luminance( cte.red, cte.green, cte.blue );
++ if( lum > maxLum )
++ {
++ maxLum = lum ;
++ bgCol = i ;
++ }
++
++ if( lum < minLum )
++ {
++ minLum = lum ;
++ fgCol = i ;
++ }
+ }
++
++ printf( "bgcolor %u, fg %u\n", bgCol, fgCol );
++ lcd_color_fg = fgCol ;
++ lcd_color_bg = bgCol ;
+ }
+
+ padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
+@@ -653,16 +734,16 @@
+
+ bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset);
+ fb = (uchar *) (lcd_base +
+- (y + height - 1) * lcd_line_length + x);
++ (y + height - 1) * panel_info.vl_lcd_line_length + x);
+ for (i = 0; i < height; ++i) {
+ for (j = 0; j < width ; j++)
+-#if defined(CONFIG_PXA250)
++#if defined(CONFIG_PXA250) || defined(CONFIG_PXA270)
+ *(fb++)=*(bmap++);
+ #elif defined(CONFIG_MPC823)
+ *(fb++)=255-*(bmap++);
+ #endif
+- bmap += (width - padded_line);
+- fb -= (width + lcd_line_length);
++ bmap += (padded_line-width);
++ fb -= (width + panel_info.vl_lcd_line_length);
+ }
+
+ return (0);
+@@ -735,7 +816,7 @@
+ #endif /* LCD_INFO */
+
+ #if defined(CONFIG_LCD_LOGO) && !defined(LCD_INFO_BELOW_LOGO)
+- return ((void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length));
++ return ((void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * panel_info.vl_lcd_line_length));
+ #else
+ return ((void *)lcd_base);
+ #endif /* CONFIG_LCD_LOGO */
+diff -u -r --new-file u-boot-1.1.2/common/lcd_panels.c u-boot-1.1.2-neon/common/lcd_panels.c
+--- u-boot-1.1.2/common/lcd_panels.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/common/lcd_panels.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,286 @@
++/*
++ * Module lcd_panels.cpp
++ *
++ * This module defines the num_lcd_panels and lcd_panels
++ * constants as declared in lcd_panels.h
++ *
++ * Change History :
++ *
++ * $Log: lcd_panels.c,v $
++ * Revision 1.9 2006/05/23 18:46:39 ericn
++ * -added hitachi_wxga panel
++ *
++ * Revision 1.8 2005/09/19 13:15:43 ericn
++ * -updated sharp_qvga timing
++ *
++ * Revision 1.7 2005/07/18 03:05:35 ericn
++ * -update crt1024x768 timings
++ *
++ * Revision 1.6 2005/07/07 03:42:22 tkisky
++ * -make my CRT 1024x768 display work
++ *
++ * Revision 1.5 2005/06/02 04:02:39 ericn
++ * -added qvga_portrait
++ *
++ * Revision 1.4 2005/05/15 18:59:00 tkisky
++ * -change polarity of hitachi_wvga
++ *
++ * Revision 1.3 2005/05/03 15:32:11 ericn
++ * -fast pixclock for hvga, remove redundant 1024x768
++ *
++ * Revision 1.2 2005/04/30 20:33:22 ericn
++ * -added CRT support
++ *
++ * Revision 1.1 2005/04/09 17:49:17 ericn
++ * -Initial import
++ *
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++
++#include "lcd_panels.h"
++#include <common.h>
++
++/*
++Settings for Hitachi 5.7
++ PANEL_HORIZONTAL_TOTAL, 01c00160); // should be 34+320+1+64-1= 418 = 0x1A2 (Hex)
++ + 0x13f+16
++ PANEL_HORIZONTAL_SYNC, 00400161); hsync_len == 64 lmargin=0x161-0x13f=34
++ PANEL_VERTICAL_TOTAL, 0x010800f0);
++ PANEL_VERTICAL_SYNC, 0x00020104); vsync=2, upper_margin=0x0104-0xf0-1= 19
++
++In bdlogo.bmp - offset 436 is pixel data
++
++Sharp 5.7 active
++
++ STUFFREG( hTotalReg, 0x01800140 ); // should be 16+320+1+8-1 == 0x158
++ + 0x13f (width-1)
++ STUFFREG( hSyncReg, 0x0008014f ); hsync_len == 8 lmargin=0x14f-0x13f=16
++ STUFFREG( vTotalReg, 0x010700F0 );
++ STUFFREG( vSyncReg, 0x00020100 ); vsync=2, upper_margin=0x0100-0xf0+1= 17
++
++static unsigned const hTotalReg = 0x00080024 ; // 015F0140
++static unsigned const hSyncReg = 0x00080028 ; // 0008014f
++static unsigned const vTotalReg = 0x0008002c ; // 010700F0
++static unsigned const vSyncReg = 0x00080030 ; // 000200FE
++
++const unsigned int sm501_list2[]={0x0fe80000,
++dispctrl 0x0F013104, // 0f0d0105
++pan 0x00000000,
++colorkey 0x00000000,
++fbaddr 0x00000000,
++offsetww ((LCD_XRES)<<16)+(LCD_XRES),
++fbwidth (LCD_XRES<<16),
++fbheight (LCD_YRES<<16),
++tllocate 0x00000000,
++brlocate ((LCD_YRES-1)<<16)+(LCD_XRES-1),
++htotal ((LCD_BEGIN_OF_LINE_WAIT_COUNT+
++ LCD_XRES+
++ LCD_END_OF_LINE_WAIT_COUNT+
++ LCD_HORIZONTAL_SYNC_PULSE_WIDTH-1)<<16)
++ +(LCD_XRES-1),
++hsync (LCD_HORIZONTAL_SYNC_PULSE_WIDTH<<16)
++ +(LCD_XRES+LCD_BEGIN_OF_LINE_WAIT_COUNT-1),
++vtotal ((LCD_BEGIN_FRAME_WAIT_COUNT+
++ LCD_YRES+
++ LCD_END_OF_FRAME_WAIT_COUNT+
++ LCD_VERTICAL_SYNC_PULSE_WIDTH-1)<<16)
++ +(LCD_YRES-1),
++vsync (LCD_VERTICAL_SYNC_PULSE_WIDTH<<16)
++ +(LCD_YRES+LCD_BEGIN_FRAME_WAIT_COUNT-1)};
++*/
++
++static struct lcd_panel_info_t const lcd_panels_[] = {
++
++ /* char const *name */ { "hitachi_qvga"
++ /* unsigned long pixclock */ , 0
++ /* unsigned short xres */ , 320
++ /* unsigned short yres */ , 240
++ /* unsigned char act_high */ , 1
++ /* unsigned char hsync_len */ , 64
++ /* unsigned char left_margin */ , 1
++ /* unsigned char right_margin */ , 16
++ /* unsigned char vsync_len */ , 20
++ /* unsigned char upper_margin */ , 8
++ /* unsigned char lower_margin */ , 3
++ /* unsigned char active */ , 1
++ /* unsigned char crt */ , 0 }
++
++ /* char const *name */ , { "sharp_qvga"
++ /* unsigned long pixclock */ , 0
++ /* unsigned short xres */ , 320 /* , 320 */
++ /* unsigned short yres */ , 240 /* , 240 */
++ /* unsigned char act_high */ , 1 /* , 1 */
++ /* unsigned char hsync_len */ , 20 /* , 8 */
++ /* unsigned char left_margin */ , 1 /* , 16 */
++ /* unsigned char right_margin */ , 30 /* , 1 */
++ /* unsigned char vsync_len */ , 4 /* , 20 */
++ /* unsigned char upper_margin */ , 17 /* , 17 */
++ /* unsigned char lower_margin */ , 3 /* , 3 */
++ /* unsigned char active */ , 1 /* , 1 */
++ /* unsigned char crt */ , 0 }
++
++ /* char const *name */ , { "qvga_portrait"
++ /* unsigned long pixclock */ , 0
++ /* unsigned short xres */ , 240
++ /* unsigned short yres */ , 320
++ /* unsigned char act_high */ , 1
++ /* unsigned char hsync_len */ , 64
++ /* unsigned char left_margin */ , 34
++ /* unsigned char right_margin */ , 1
++ /* unsigned char vsync_len */ , 20
++ /* unsigned char upper_margin */ , 8
++ /* unsigned char lower_margin */ , 3
++ /* unsigned char active */ , 1
++ /* unsigned char crt */ , 0
++ /* unsigned rotation */ , 90 }
++
++ /* char const *name */ , { "hitachi_hvga"
++ /* unsigned long pixclock */ , 1
++ /* unsigned short xres */ , 640
++ /* unsigned short yres */ , 240
++ /* unsigned char act_high */ , 1
++ /* unsigned char hsync_len */ , 64
++ /* unsigned char left_margin */ , 34
++ /* unsigned char right_margin */ , 1
++ /* unsigned char vsync_len */ , 20
++ /* unsigned char upper_margin */ , 8
++ /* unsigned char lower_margin */ , 3
++ /* unsigned char active */ , 1
++ /* unsigned char crt */ , 0 }
++
++ /* char const *name */ , { "sharp_vga"
++ /* unsigned long pixclock */ , 1
++ /* unsigned short xres */ , 640
++ /* unsigned short yres */ , 480
++ /* unsigned char act_high */ , 1
++ /* unsigned char hsync_len */ , 64
++ /* unsigned char left_margin */ , 60
++ /* unsigned char right_margin */ , 60
++ /* unsigned char vsync_len */ , 20
++ /* unsigned char upper_margin */ , 34
++ /* unsigned char lower_margin */ , 3
++ /* unsigned char active */ , 1
++ /* unsigned char crt */ , 0 }
++
++ /* char const *name */ , { "hitachi_wvga"
++ /* unsigned long pixclock */ , 1
++ /* unsigned short xres */ , 800
++ /* unsigned short yres */ , 480
++ /* unsigned char act_high */ , 1
++ /* unsigned char hsync_len */ , 64
++ /* unsigned char left_margin */ , 1
++ /* unsigned char right_margin */ , 39
++ /* unsigned char vsync_len */ , 20
++ /* unsigned char upper_margin */ , 8
++ /* unsigned char lower_margin */ , 3
++ /* unsigned char active */ , 1
++ /* unsigned char crt */ , 0 }
++// Note that you can use the nifty tool at the
++// following location to generate these values:
++// http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html
++, {
++ name: "crt1024x768",
++ pixclock: 65000000,
++ xres: 1024,
++ yres: 768,
++ act_high : 0,
++ hsync_len: 136,
++ left_margin: 24,
++ right_margin: 160,
++ vsync_len: 6,
++ upper_margin: 3,
++ lower_margin: 29,
++ active : 0,
++ crt : 1
++}
++, {
++ name: "hitachi_wxga",
++ pixclock: 1,
++ xres: 1024,
++ yres: 768,
++ act_high : 1,
++ hsync_len: 64,
++ left_margin: 1,
++ right_margin: 39,
++ vsync_len: 20,
++ upper_margin: 8,
++ lower_margin: 3,
++ active : 1,
++ crt : 0
++}
++};
++
++/*
++. e
++typedef enum _polarity_t
++{
++ POSITIVE,
++ NEGATIVE,
++}
++polarity_t;
++
++typedef struct _mode_table_t
++{
++ // Horizontal timing.
++ int horizontal_total;
++ int horizontal_display_end;
++ int horizontal_sync_start;
++ int horizontal_sync_width;
++ polarity_t horizontal_sync_polarity;
++
++ // Vertical timing.
++ int vertical_total;
++ int vertical_display_end;
++ int vertical_sync_start;
++ int vertical_sync_height;
++ polarity_t vertical_sync_polarity;
++
++ // Refresh timing.
++ long pixel_clock;
++ long horizontal_frequency;
++ long vertical_frequency;
++}
++mode_table_t;
++
++ // 1024 x 768
++ htotal dend hsstrt hsw hpolar vtot vdend vdstrt vsh vpolar pixclk hfreq vfreq
++{ 1344, 1024, 1048, 136, NEGATIVE, 806, 768, 771, 6, NEGATIVE, 65000000, 48363, 60 },
++{ 1328, 1024, 1048, 136, NEGATIVE, 806, 768, 771, 6, NEGATIVE, 75000000, 56476, 70 },
++{ 1312, 1024, 1040, 96, POSITIVE, 800, 768, 769, 3, POSITIVE, 78750000, 60023, 75 },
++{ 1376, 1024, 1072, 96, POSITIVE, 808, 768, 769, 3, POSITIVE, 94500000, 68677, 85 },
++
++0FE80200/00010000 + CRT regs
++0FE80204/00180000 +
++0FE80208/08000800 +
++0FE8020C/05D003FF +
++0FE80210/00C80424 +
++0FE80214/032502FF +
++0FE80218/00060302 +
++0FE8021C/00000000 +
++0FE80220/00000000 +
++0FE80224/00400200 +
++0FE80228/00000000 +
++0FE8022C/00000000 +
++0FE80230/00000800 +
++0FE80234/00000000 +
++0FE80238/08000000 +
++0FE8023C/00000400 +
++*/
++
++struct lcd_panel_info_t const * const lcd_panels = lcd_panels_ ;
++unsigned const num_lcd_panels = sizeof(lcd_panels_)/sizeof(lcd_panels_[0]);
++
++struct lcd_panel_info_t const *find_lcd_panel( char const * name )
++{
++ unsigned i ;
++ for( i = 0 ; i < num_lcd_panels ; i++ )
++ {
++ if( 0 == strcmp( lcd_panels_[i].name, name ) )
++ return lcd_panels_+i ;
++ }
++ return 0 ;
++}
++
++struct lcd_panel_info_t const *cur_lcd_panel = 0 ;
+diff -u -r --new-file u-boot-1.1.2/common/Makefile u-boot-1.1.2-neon/common/Makefile
+--- u-boot-1.1.2/common/Makefile 2004-12-16 18:35:57.000000000 +0100
++++ u-boot-1.1.2-neon/common/Makefile 2007-08-11 21:07:20.000000000 +0200
+@@ -35,16 +35,16 @@
+ cmd_eeprom.o cmd_elf.o cmd_ext2.o \
+ cmd_fat.o cmd_fdc.o cmd_fdos.o cmd_flash.o cmd_fpga.o \
+ cmd_i2c.o cmd_ide.o cmd_immap.o cmd_itest.o cmd_jffs2.o \
+- cmd_load.o cmd_log.o \
++ cmd_lcdpanel.o cmd_load.o cmd_log.o \
+ cmd_mem.o cmd_mii.o cmd_misc.o cmd_mmc.o \
+- cmd_nand.o cmd_net.o cmd_nvedit.o \
++ cmd_nand.o cmd_net.o cmd_not.o cmd_nvedit.o \
+ cmd_pci.o cmd_pcmcia.o cmd_portio.o \
+ cmd_reginfo.o cmd_reiser.o cmd_scsi.o cmd_spi.o cmd_universe.o cmd_usb.o cmd_vfd.o \
+ command.o console.o devices.o dlmalloc.o docecc.o \
+ environment.o env_common.o \
+ env_nand.o env_dataflash.o env_flash.o env_eeprom.o env_nvram.o env_nowhere.o exports.o \
+- flash.o fpga.o \
+- hush.o kgdb.o lcd.o lists.o lynxkdi.o \
++ flash.o fnmatch.o fpga.o \
++ hush.o kgdb.o lcd.o lcd_panels.o lists.o lynxkdi.o \
+ memsize.o miiphybb.o miiphyutil.o \
+ s_record.o serial.o soft_i2c.o soft_spi.o spartan2.o \
+ usb.o usb_kbd.o usb_storage.o \
+diff -u -r --new-file u-boot-1.1.2/config.mk u-boot-1.1.2-neon/config.mk
+--- u-boot-1.1.2/config.mk 2004-10-10 00:21:30.000000000 +0200
++++ u-boot-1.1.2-neon/config.mk 2007-08-11 21:07:20.000000000 +0200
+@@ -22,6 +22,7 @@
+ #
+
+ #########################################################################
++sinclude select.mk # include DISPLAY_TYPE, HARDWARE_TYPE, SOFTWARE_TYPE, INCLUDE_MINIDEBUG
+
+ # clean the slate ...
+ PLATFORM_RELFLAGS =
+@@ -106,11 +107,15 @@
+ OPTFLAGS= -Os #-fomit-frame-pointer
+ ifndef LDSCRIPT
+ #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
++ifeq ($(INCLUDE_MINIDEBUG),y)
++LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-bootmini.lds
++else
+ LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+ endif
++endif
+ OBJCFLAGS += --gap-fill=0xff
+
+-gccincdir := $(shell $(CC) -print-file-name=include)
++gccincdir := "$(shell $(CC) -print-file-name=include)"
+
+ CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
+ -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
+@@ -170,11 +175,19 @@
+
+ #########################################################################
+
++ifdef LISTINGS
++%.s: %.S
++ $(CPP) $(AFLAGS) -Wa,-alh=$(basename $<).lst -o $@ $(CURDIR)/$<
++%.o: %.S
++ $(CC) $(AFLAGS) -c -Wa,-alh=$(basename $<).lst -o $@ $(CURDIR)/$<
++%.o: %.c
++ $(CC) $(CFLAGS) -c -Wa,-alh=$(basename $<).lst -o $@ $<
++else
+ %.s: %.S
+ $(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
+ %.o: %.S
+ $(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
+ %.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+-
++endif
+ #########################################################################
+diff -u -r --new-file u-boot-1.1.2/Configure u-boot-1.1.2-neon/Configure
+--- u-boot-1.1.2/Configure 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/Configure 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,170 @@
++#!/bin/bash
++#=======================================================================
++DISPLAY_TYPE_CHOICES="DA640X240 DA320X240 DA800X480 DA640X480 DA240X320 DA800X600 DA1024X768 DP320X240 DP480X320 DL122X32"
++PLATFORM_TYPE_CHOICES="NEONB NEON HALOGEN BD2003 GAME_WITH_SMC GAME_CONTROLLER"
++# BOUNDARY_OLD_BOARD #lcd pin reordering for rgb problem, don't use VLIO(gp18 is turnstile)
++# OLD_GAME_CONTROLLER GAME_CONTROLLER_PLAITED_A1
++REVISION_CHOICES="1 2"
++
++SOFTWARE_TYPE_CHOICES="WINCE LINUX GAME"
++INCLUDE_MINIDEBUG_CHOICES="y n"
++CPU_CLOCK_CHOICES="100 200 300 400"
++CPU_CLOCK_PXA270_CHOICES="104 208 312 416 520 624"
++
++CONFIG_H=include/configs/select.h
++CONFIG_MK=select.mk
++CONFIG_LOG=select.log
++
++fail ()
++{
++ echo ""
++ echo "Configuration failed."
++ echo ""
++ exit 1
++}
++
++if [ -f $CONFIG_MK ] ; then
++. ./$CONFIG_LOG
++fi
++
++
++
++#=======================================================================
++
++
++arg () {
++ VALUE="`echo X"$2" | sed -e 's/^X--[a-zA-Z_]*=//'`"
++ eval $1=\"$VALUE\"
++ eval $1_P='y'
++}
++
++usage () {
++ echo "bad parameters"
++ exit 1
++}
++
++while [ $# -gt 0 ] ; do
++ case "$1" in
++ --DISPLAY_TYPE=*) arg DISPLAY_TYPE $1 ;;
++ --PLATFORM_TYPE=*) arg PLATFORM_TYPE $1 ;;
++ --SOFTWARE_TYPE=*) arg SOFTWARE_TYPE $1 ;;
++ --INCLUDE_MINIDEBUG=*) arg INCLUDE_MINIDEBUG $1 ;;
++ --CPU_CLOCK=*) arg CPU_CLOCK $1 ;;
++ *) usage ;;
++ esac
++ shift
++done
++
++#=======================================================================
++
++write_str () {
++ value=`eval echo '$'$1`
++ echo "$1=$value" >> $CONFIG_MK
++ echo "$1=\"$value\"" >> $CONFIG_LOG
++ if [ x$3 != x ] ; then
++ choices=`eval echo '$'$2`
++ str=""
++ for a in $choices ; do
++ if [ -n "$str" ] ; then str="$str && " ; fi
++ str="$str!defined($3$a)";
++ done
++ echo "#if $str" >> $CONFIG_H
++ echo "#define $3$value" >> $CONFIG_H
++ echo "#endif" >> $CONFIG_H
++ else
++ echo "#ifndef $1" >> $CONFIG_H
++ echo "#define $1 $value" >> $CONFIG_H
++ echo "#endif" >> $CONFIG_H
++ fi
++}
++
++prompt () {
++ eval $3=\"$2\"
++ /bin/echo -e "$1 [$2]: \c"
++ read tmp
++ if [ -n "$tmp" ] ; then eval $3=\"$tmp\" ; fi
++ if [ ! -t 1 ] ; then echo $3 ; fi
++}
++noprompt () {
++ eval $3=\"$2\"
++ /bin/echo -e "$1 [$2]: "
++ if [ ! -t 1 ] ; then echo $3 ; fi
++}
++
++
++ask_str () {
++ choices=`eval echo '$'$3`
++ default=`eval echo '$'$2`
++ ppp=`eval echo '$'$2_P`
++ ans=""
++ stop="0"
++ if [ x$ppp = x"y" ] ; then
++ noprompt "$1 ($choices)" "$default" answer
++ for a in $choices ; do
++ if [ x$a = x$answer ] ; then ans=$a; stop="1"; break; fi;
++ done
++ if [ $stop != "1" ] ; then default=""; fi;
++ fi
++ while [ $stop != "1" ] ; do
++ prompt "$1 ($choices)" "$default" answer
++ for a in $choices ; do
++ if [ x$a = x$answer ] ; then ans=$a; stop="1"; break; fi;
++ done
++ done
++ eval $2=\"$ans\"
++}
++#=======================================================================
++
++echo ""
++echo " -------- U-Boot Boundary Devices Specific Configuration Script --------"
++echo ""
++echo ""
++
++ask_str "Choose display type" DISPLAY_TYPE DISPLAY_TYPE_CHOICES
++ask_str "Choose hardware type" PLATFORM_TYPE PLATFORM_TYPE_CHOICES
++ if [ x$PLATFORM_TYPE = xHALOGEN ] ; then
++ask_str "Choose hardware revision" PLATFORM_REV REVISION_CHOICES
++ fi
++ask_str "Choose software type" SOFTWARE_TYPE SOFTWARE_TYPE_CHOICES
++ask_str "Include minidebug" INCLUDE_MINIDEBUG INCLUDE_MINIDEBUG_CHOICES
++
++ if [ x$PLATFORM_TYPE = xHALOGEN ] ; then
++ask_str "CPU clock" CPU_CLOCK CPU_CLOCK_PXA270_CHOICES
++ else
++ask_str "CPU clock" CPU_CLOCK CPU_CLOCK_CHOICES
++ fi
++
++rm -f $CONFIG_H $CONFIG_MK
++
++cat << 'EOF' > $CONFIG_H
++/*
++ Automatically generated by 'make xxx_config' -- don't edit!
++*/
++#include <asm/arch/platformTypes.h>
++EOF
++
++cat << 'EOF' > $CONFIG_MK
++#
++# Automatically generated by 'make xxx_config' -- don't edit!
++#
++EOF
++
++cat << 'EOF' > $CONFIG_LOG
++#!/bin/bash
++EOF
++
++chmod 777 $CONFIG_LOG
++
++write_str DISPLAY_TYPE DISPLAY_TYPE_CHOICES
++write_str PLATFORM_TYPE PLATFORM_TYPE_CHOICES
++ if [ x$PLATFORM_TYPE = xHALOGEN ] ; then
++write_str PLATFORM_REV REVISION_CHOICES
++ fi
++write_str SOFTWARE_TYPE SOFTWARE_TYPE_CHOICES
++write_str INCLUDE_MINIDEBUG INCLUDE_MINIDEBUG_CHOICES
++ if [ x$PLATFORM_TYPE = xHALOGEN ] ; then
++write_str CPU_CLOCK CPU_CLOCK_PXA270_CHOICES
++ else
++write_str CPU_CLOCK CPU_CLOCK_CHOICES
++ fi
++echo "Configuration successful."
+diff -u -r --new-file u-boot-1.1.2/cpu/mpc8xx/lcd.c u-boot-1.1.2-neon/cpu/mpc8xx/lcd.c
+--- u-boot-1.1.2/cpu/mpc8xx/lcd.c 2004-10-10 01:26:00.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/mpc8xx/lcd.c 2007-08-11 21:07:20.000000000 +0200
+@@ -255,7 +255,6 @@
+ /*----------------------------------------------------------------------*/
+
+
+-int lcd_line_length;
+
+ int lcd_color_fg;
+ int lcd_color_bg;
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/config.mk u-boot-1.1.2-neon/cpu/pxa/config.mk
+--- u-boot-1.1.2/cpu/pxa/config.mk 2003-05-23 14:36:21.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/pxa/config.mk 2007-08-11 21:15:47.000000000 +0200
+@@ -21,8 +21,19 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ # MA 02111-1307 USA
+ #
+-
+-PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
+- -mshort-load-bytes -msoft-float
+-
+-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100
+++sinclude ../../select.mk # include DISPLAY_TYPE, HARDWARE_TYPE, SOFTWARE_TYPE, INCLUDE_MINIDEBUG
+++
+++PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8
+++PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
+++GCC_MAJOR := $(shell $(CC) -v 2>&1 | grep version | cut -d' ' -f3 | cut -d'.' -f1)
+++GCC_MINOR := $(shell $(CC) -v 2>&1 | grep version | cut -d' ' -f3 | cut -d'.' -f2)
+++
+++ifneq ($(GCC_MAJOR),3)
+++ PLATFORM_CPPFLAGS += -mtune=strongarm1100
+++ PLATFORM_RELFLAGS += -msoft-float
+++else
+++ PLATFORM_CPPFLAGS += -mtune=xscale
+++ ifneq ($(GCC_MINOR),4)
+++ PLATFORM_RELFLAGS += -msoft-float
+++ endif
+++endif
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/cpu.c u-boot-1.1.2-neon/cpu/pxa/cpu.c
+--- u-boot-1.1.2/cpu/pxa/cpu.c 2004-02-08 20:38:44.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/cpu.c 2007-08-11 21:07:20.000000000 +0200
+@@ -33,6 +33,7 @@
+ #include <common.h>
+ #include <command.h>
+ #include <asm/arch/pxa-regs.h>
++#include <asm/arch/mmc.h>
+
+ int cpu_init (void)
+ {
+@@ -59,8 +60,12 @@
+
+ unsigned long i;
+
++ MMC_STRPCL = MMC_STRPCL_STOP_CLK;
++
+ disable_interrupts ();
+
++ dcache_disable();
++
+ /* turn off I-cache */
+ asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
+ i &= ~0x1000;
+@@ -129,21 +134,6 @@
+ return (i & 0x1000);
+ }
+
+-/* we will never enable dcache, because we have to setup MMU first */
+-void dcache_enable (void)
+-{
+- return;
+-}
+-
+-void dcache_disable (void)
+-{
+- return;
+-}
+-
+-int dcache_status (void)
+-{
+- return 0; /* always off */
+-}
+
+ void set_GPIO_mode(int gpio_mode)
+ {
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/Makefile u-boot-1.1.2-neon/cpu/pxa/Makefile
+--- u-boot-1.1.2/cpu/pxa/Makefile 2003-06-16 00:40:43.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/pxa/Makefile 2007-08-11 21:07:20.000000000 +0200
+@@ -23,10 +23,45 @@
+
+ include $(TOPDIR)/config.mk
+
++CPU_TYPE=xscale
++
++ifeq ($(SOFTWARE_TYPE),WINCE)
++STACKS_VALID = -DCONFIG_STACKS_VALID
++else
++
++ifeq ($(SOFTWARE_TYPE),GAME)
++STACKS_VALID = -DCONFIG_STACKS_VALID
++else
++STACKS_VALID =
++endif
++endif
++ARM_ELF_GCC ?= arm-elf-gcc
++
+ LIB = lib$(CPU).a
+
+-START = start.o
+-OBJS = serial.o interrupts.o cpu.o i2c.o pxafb.o mmc.o
++ifeq ($(INCLUDE_MINIDEBUG),y)
++START = minidebug.o ministart.o
++else
++START = start.o ministart.o
++endif
++OBJS = serial.o interrupts.o cpu.o i2c.o mmc.o
++
++ifdef PXALCD
++ OBJS += pxafb.o
++endif
++
++ifeq ($(PLATFORM_TYPE),HALOGEN)
++ OBJS += usb_ohci.o
++else
++ifeq ($(PLATFORM_TYPE),NEON)
++ OBJS += usb_ohci.o
++else
++ifeq ($(PLATFORM_TYPE),NEONB)
++ OBJS += usb_ohci.o
++else
++endif
++endif
++endif
+
+ all: .depend $(START) $(LIB)
+
+@@ -35,9 +70,13 @@
+
+ #########################################################################
+
+-.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c)
+- $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
++.depend: Makefile $(START) $(OBJS)
++ $(CC) -M $(CFLAGS) -DUBOOT=1 $(START:.o=.S) $(OBJS:.o=.c) > $@
+
+ sinclude .depend
+
++minidebug.o : minidebug.S Makefile
++ $(ARM_ELF_GCC) -c $(D_GNUC) -DUBOOT=1 -DDISPLAY_TYPE=$(DISPLAY_TYPE) -DPLATFORM_TYPE=$(PLATFORM_TYPE) -DPLATFORM_REV=$(PLATFORM_REV) -DSOFTWARE_TYPE=$(SOFTWARE_TYPE) $(STACKS_VALID) -DCPU_CLOCK=$(CPU_CLOCK) \
++ $(SOFT_FLOAT) -I$(TOPDIR)/include -mtune=$(CPU_TYPE) -mcpu=$(CPU_TYPE) -o $@ $<
++
+ #########################################################################
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/minidebug.S u-boot-1.1.2-neon/cpu/pxa/minidebug.S
+--- u-boot-1.1.2/cpu/pxa/minidebug.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/minidebug.S 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,3850 @@
++ .nolist
++ .ifdef __ARMASM
++UBOOT EQU 0
++CONFIG_UNSCRAMBLE_LCD EQU 0
++LCD_REORDER_BLUE EQU 1
++ .endif
++
++#ifdef UBOOT
++#include <asm/arch/platformTypes.h>
++#include <configs/select.h>
++#include <asm/arch/pxaGpio.h>
++#include <asm/arch/pxaMacro3.h>
++#include <asm/arch/miniMac.inc>
++#include <asm/arch/burn.inc>
++#else
++#include "platformTypes.h"
++#include "pxaGpio.h"
++#include "pxaMacro3.h"
++#include "miniMac.inc"
++#include "burn.inc"
++ .ifdef __ARMASM
++ STARTUPTEXT
++ EXTERN HeadStart
++ .endif
++#endif
++
++ .list
++ .global StartUp
++
++
++#define L1(a) ((CH_##a))
++#define L2(a,b) ((CH_##a)+(CH_##b<<8))
++#define L3(a,b,c) ((CH_##a)+(CH_##b<<8)+(CH_##c<<16))
++#define L4(a,b,c,d) ((CH_##a)+(CH_##b<<8)+(CH_##c<<16)+(CH_##d<<24))
++
++#define C2(a,b) ((CH_##a<<8)+(CH_##b))
++#define C3(a,b,c) ((CH_##a<<16)+(CH_##b<<8)+(CH_##c))
++#define C4(a,b,c,d) ((CH_##a<<24)+(CH_##b<<16)+(CH_##c<<8)+(CH_##d))
++
++// *******************************************************************************************
++// *******************************************************************************************
++
++
++//.global _start
++//_start:
++StartUp:
++ b V_Reset //0
++ b V_UndefinedInstr //4
++ b V_SWI //8
++ b V_PrefetchAbort //0x0c
++ b V_DataAbort //0x10
++ b V_Unused //0x14, not used
++ b V_IRQ //0x18
++// b V_FIQ //0x1c
++
++//In Linux, all modes switch almost immediately to the SVC mode
++//and it is the only one with a valid stack
++//FIQ & SWI stacks are always assumed valid
++V_FIQ:
++ V_VectorEntrance V_rWork,V_rBranch,SIG_FIQ
++
++join_fiq:
++ CheckBranch V_rWork,V_rBranch
++ V_VectorExitCC V_rWork,V_rBranch,eq,eqia
++ CheckLdr V_rWork,V_rBranch
++ V_VectorExitCC1 V_rWork,V_rBranch,cc,ccia
++join_fiq2:
++ sub sp,sp,#(DEBUG_SPACE-DBG_R0) //the extra 12 bytes already on stack are needed for indirect return for SDS bug
++ stmia sp,{r0,r1}
++ sub r1,V_rBranch,#8 //restore to SIG_xxx value
++ add r0,sp,#(DEBUG_SPACE-DBG_R0)
++ ldr V_rWork,[r0],#4
++ ldr V_rBranch,[r0],#8
++ str r0,[sp,#DBG_HSP-DBG_R0]
++ sub r0,sp,#DBG_R0
++join_fiq3:
++ mov r1,r1,LSR #2
++ and r1,r1,#0xf
++ b SaveRest2
++V_Reset:
++//this is either a normal processor reset, or a debug exception in halt mode
++ mrs sp,cpsr
++ and sp,sp,#0x1f
++ cmp sp,#0x15
++ bne 2f
++//this is a debug exception in halt mode
++ CP14_DCSR mrc,sp
++ and sp,sp,#0x1c
++ cmp sp,#0 //reset
++ cmpne sp,#5<<2 //vector trap (reset vector)
++ bne 10f //initialization already done
++
++ BigMov sp,PWR_MANAGER_BASE
++ ldr sp,[sp,#RCSR]
++ tst sp,#2
++ tsteq pc,#0xff000000
++ bne 2f //br if watchdog reset or if not nCS0 address
++
++//signal debugger that he can download into main instruction cache now
++ CP14_TX mcr,sp
++1:
++ CP14_TXRXCTRL mrc,r15 //r15 means update condition codes
++ bpl 1b
++ CP14_RX mrc,sp //just read and discard
++2:
++ CP14_DCSR mrc,sp
++ orr sp,sp,#1<<31 //set global debug enable bit
++ CP14_DCSR mcr,sp
++
++// InitGPIO r0,sp
++// InitIC_Clocks r0,sp
++// InitUART r0,sp,UART_BASE,BAUDRATE
++// TransMacro L1(U)
++ b MainInitializationCode //this can be in the main instruction cache not locked
++ //because it is only executed upon reset
++
++10:
++ cmp sp,#1<<2 //Instruction breakpoint
++ mov sp,r0 //save r0
++ BigMov r0,DEBUG_BASE
++ str sp,[r0,#DBG_R0]
++ str r1,[r0,#DBG_R1]
++ str r2,[r0,#DBG_R2]
++SSDebug:
++ bne 11f
++//this is a breakpoint
++ ldr r1,[r0,#DBG_TRACE]
++ tst r1,#1
++ beq 11f
++ cmn r1,#1
++ moveq r1,#0
++ CP15_IBCR1 mrc,sp
++ sub r2,lr,#3
++ cmp sp,r2
++ CP15_IBCR1 mcreq,r1 //remove breakpoint if single-stepping
++ beq 11f
++ CP15_IBCR0 mrc,sp
++ cmp sp,r2
++ CP15_IBCR0 mcreq,r1
++11:
++ mrs r2,spsr
++ sub lr,lr,#4
++
++ str r3,[r0,#DBG_R3]
++ ldrb r3,[r0,#DBG_Mode]
++SaveDebug:
++ CP14_DCSR mrc,sp
++// str sp,[r0,#DBG_Temp] //the mcr CP14_DCSR instruction below will trash sp in SDS (special debug state)
++ and r1,sp,#0x1c
++ orr sp,sp,#0x1c
++ CP14_DCSR mcr,sp
++ mov r1,r1,LSR #2
++ add r1,r1,#SIG_DBG
++ b SaveR4andUp
++
++V_UndefinedInstr:
++ VectorEntrance rWork,rBranch,SIG_UNDEFINED_INSTRUCTION
++ JOIN b
++V_IRQ:
++ VectorEntrance rWork,rBranch,SIG_IRQ
++
++ .if STACKS_VALID
++ JOIN b
++ .else
++join_irq:
++ CheckBranch I_rWork,I_rBranch
++ I_VectorExitCC I_rWork,I_rBranch,eq,eqia
++
++ CheckLdr I_rWork,I_rBranch
++ I_VectorExitCC1 I_rWork,I_rBranch,cc,ccia
++join_irq2:
++ strd r0,[I_rWork,#DBG_R0-DBG_MAGIC]
++ sub r0,I_rWork,#DBG_MAGIC
++ sub r1,I_rBranch,#8 //restore to SIG_xxx value
++ ldr I_rWork,[r0,#DBG_TEMP]
++ add sp,r0,#DBG_INDIRECT_R0+8 //sp is trashed, if stacks assumed invalid
++ str sp,[r0,#DBG_HSP]
++ b join_fiq3
++ .endif
++
++//sp is valid for this!!!!!, what a treat
++V_SWI:
++ V_VectorEntrance V_rWork,V_rBranch,SIG_SWI
++ b join_fiq
++
++//monitor mode also has instruction breakpoint, bkpt instruction
++V_PrefetchAbort:
++ VectorEntrance rWork,rBranch,SIG_PREFETCH_ABORT
++ CP15_FSR mrc,rWork
++ tst rWork,#1<<9
++ bne DEBUG_EVENT //br if a debug event, in monitor mode
++
++//the 1st instruction after exiting special debug state can cause an abort or possibly the wrong instruction to execute.
++//the Immu is not turned on until the 2nd instruction.
++ tst rWork,#1<<10
++ JOIN beq
++ and rWork,rWork,#0xf
++ cmp rWork,#0x6
++ JOIN bne //br if not an external abort
++
++ CP15_CONTROL mrc,rWork //get the control register
++ tst rWork,#1 //test MMU
++
++ BigMov rWork,DEBUG_BASE+DBG_ABORT_PC
++ swpne rWork,lr,[rWork] //save lr as a flag so not infinite errors, if mmu on
++ cmpne rWork,lr
++
++ .if STACKS_VALID
++ ldrne rBranch,[sp,#4]
++ ldrne rWork,[sp],#12
++ subnes pc,lr,#4 //retry access
++ .else
++ BigMov rWork,DEBUG_BASE+DBG_MAGIC
++ ldrne rWork,[rWork,#DBG_TEMP-DBG_MAGIC]
++ subnes pc,lr,#4 //retry access
++ .endif
++
++ add rBranch,rBranch,#8
++ JOIN2 b
++
++//stacks aren't kept valid
++//monitor mode also has data breakpoint, external debug break, trace-buffer full break
++V_DataAbort:
++ VectorEntrance rWork,rBranch,SIG_DATA_ABORT
++ CP15_FSR mrc,rWork
++ tst rWork,#1<<9
++ JOIN beq
++ sub lr,lr,#4 //+8 of offending instruction for most data aborts instead of +4
++DEBUG_EVENT:
++ BigMov rWork,DEBUG_BASE+DBG_MAGIC
++ strd r0,[rWork,#DBG_R0-DBG_MAGIC]
++ sub r0,rWork,#DBG_MAGIC
++
++ .if STACKS_VALID
++ ldr rWork,[sp],#4
++ ldr rBranch,[sp],#8
++ .else
++ ldr rWork,[r0,#DBG_TEMP]
++ add sp,r0,#DBG_INDIRECT_R0+8 //sp is trashed, if stacks assumed invalid
++ .endif
++ str sp,[r0,#DBG_HSP]
++ CP14_DCSR mrc,sp
++ and sp,sp,#0x1c
++ cmp sp,#1<<2 //Instruction breakpoint
++ str r2,[r0,#DBG_R2]
++ b SSDebug
++
++V_Unused:
++ mov sp,r0 //save r0
++ BigMov r0,DEBUG_BASE
++ str sp,[r0,#DBG_R0]
++ str r1,[r0,#DBG_R1]
++ mov r1,#SIG_UNUSED
++// b SaveRest2
++
++//r0 - debug storage
++//r1 - reason for getting here
++SaveRest2:
++ str r2,[r0,#DBG_R2]
++ sub lr,lr,#4
++ mrs r2,spsr
++ str r3,[r0,#DBG_R3]
++ ldrb r3,[r0,#DBG_Mode]
++//r2 - spsr
++//r3 - DBG_MODE - don't assume that ram is working upon reset
++SaveR4andUp:
++ str r4,[r0,#DBG_R4]
++ str lr,[r0,#DBG_PC] //return PC
++ str r2,[r0,#DBG_CPSR] //return CPSR
++ mrs r4,cpsr
++ str r4,[r0,#DBG_HCPSR] //mode to return to before exception return
++
++ tst r2,#0xf
++ orreq r2,r2,#0xdf //if user mode, switch to system mode to access user registers, set I, F
++ orrne r2,r2,#0xc0 //set I, F
++ msr cpsr_c,r2
++
++ add r2,r0,#DBG_R5
++ stmia r2,{r5,r6,r7,r8,r9,sl,fp,ip,sp,lr}
++// **********************************
++// **********************************
++
++ mov rDBG,r0
++ mov r6,r1 //reason
++ mov r5,r3 //DBG_MODE
++ strb r2,[rDBG,#DBG_LastSignal]
++ CP15_CONTROL mrc,r1 //get the control register
++ tst r1,#1
++ BigMov rUart,UART_BASE //this is right if MMU is off
++ blne GetUartAddress //if MMU is on
++ b gdb_lastSignal1
++
++//r1 - CP15_CONTROL(r1)
++GetUartAddress:
++ tst r1,#1<<13 //assume 1:1 mapping for TTBR if relocation vector is off
++// see if identity mapping is enabled
++ CP15_TTBR mrc,r1
++// using Big will generate no instructions if Wince, throwing off my reloc vector
++// BigAdd2Ne r1,(SDRAM_BASE_C_VIRTUAL-0xA0000000)
++ addne r1,r1,#(SDRAM_BASE_C_VIRTUAL-0xA0000000) //convert this physical address to a virtual address if relocation vector ON
++
++ ldr r2,[r1,rUart,lsr #18]
++ sub r2,r2,rUart
++ cmp r2,#1<<20
++ movcc pc,lr //identity mapping on
++
++ mov r3,rUart
++ BigMov rUart,UART_VIRT_BASE
++1: ldr r2,[r1,rUart,lsr #18]
++ tst r2,#3
++ beq 2f
++ sub r2,r2,r3
++ cmp r2,#1<<20
++ movcc pc,lr //br if found virtual address
++ adds rUart,rUart,#1<<20
++ moveq rUart,#0xE0000000
++ b 1b
++2:
++ BigOrr2 r3,0xc02
++ str r3,[r1,rUart,lsr #18] //steal this unused entry
++// b cache_clean_invalidate_all
++
++cache_clean_invalidate_all:
++//flush data cache, if data cache is enabled
++ CP15_CONTROL mrc,r0 //get the control register
++ tst r0,#4
++ moveq pc,lr //return if disabled
++
++// Set baseaddress as the 1st virtual address of a 32k range used only
++// to flush the data cache. baseaddress should be aligned on a 32 byte(cache-line) boundary.
++// If the virtual range beginning with baseaddress is used for any purpos other than flushing
++// the data cache, then cachelinecount must be doubled from 1024 to 2048
++ mov r1,#cachelinecount
++ ldr r0,[rDBG,#DBG_PC] //I hope my return address is mapped
++ BigBic2 r0,0xffff
++1:
++ CP15_CF_ALLOC_LINE mcr,r0 //allocate a cache line for r0
++ add r0,r0,#cachelinesize
++ subs r1,r1,#1
++ bne 1b
++
++// teq r2, #0 // if running only from cache, an invalidate could be fatal if not done from minicache
++ // and then, a return to caller would not be allowed, so invalidate is postponed
++// CP15_CF_INVAL_I mcrne,r0
++ CP15_CF_DRAIN mcr,r0
++ CP15_CF_INVAL_D mcr,r0
++// The instruction cache is guaranteed to be invalidated at this point. The
++// next instruction sees the result of the invalidate command.
++ mov pc,lr
++
++
++//r0 - value to printm r9 - chksum
++PrintHexEndian:
++#if LITTLE_ENDIAN
++ mov r2,#8
++1: mov r4,r0
++ mov r3,lr
++2: tst r2,#1
++ moveq r0,r4,LSR #4
++ andne r0,r4,#0xf
++ andeq r0,r0,#0xf
++ movne r4,r4,ROR #8
++ cmp r0,#0xA
++ addcs r0,r0,#L1(a)-0x0a
++ addcc r0,r0,#L1(0)
++ add r9,r9,r0
++ bl Transmit
++ subs r2,r2,#1
++ bne 2b
++ mov pc,r3
++
++PrintHexByteEndian:
++ mov r2,#2
++ b 1b
++#else
++ mov r2,#8
++ mov r4,r0
++1: mov r3,lr
++2: mov r4,r4,ROR #28
++ and r0,r4,#0xf
++ cmp r0,#0xA
++ addcs r0,r0,#L1(a)-0x0a
++ addcc r0,r0,#L1(0)
++ add r9,r9,r0
++ bl Transmit
++ subs r2,r2,#1
++ bne 2b
++ mov pc,r3
++PrintHexByteEndian:
++ mov r4,r0,LSL #24
++ mov r2,#2
++ b 1b
++#endif
++
++PrintHexByte:
++ mov r4,r0,LSL #24
++ mov r2,#2
++ b PrintHex1
++
++TransmitCRLF:
++ BigMov r0,L2(CR,LF)
++ b Transmit
++
++
++ .if STACKS_VALID
++ .else
++// *******************************************************
++ RelocationVector 0
++// *******************************************************
++ .endif
++
++
++//IN: r0 - value to print
++//OUT: r0-r4 trashed
++PrintHex:
++ mov r2,#8
++ mov r4,r0
++PrintHex1:
++ mov r3,lr
++1: mov r4,r4,ROR #28
++ and r0,r4,#0xf
++ cmp r0,#0xA
++ addcs r0,r0,#L1(A)-0x0a
++ addcc r0,r0,#L1(0)
++ bl Transmit
++ subs r2,r2,#1
++ bne 1b
++ mov pc,r3
++
++
++TransmitSPACE:
++ mov r0,#L1(SPACE)
++// b Transmit
++
++//IN: r0 - character to transmit
++//OUT: r0 - last character transmitted, r1 - trashed
++Transmit1:
++Transmit:
++1: ldr r1,[rUart,#UART_LSR]
++ ands r1,r1,#0x20
++ beq 1b
++ mov r1,r0
++ and r1,r1,#0xff
++ str r1,[rUart,#UART_THR]
++ movs r1,r0,LSR #8
++ movne r0,r1
++ bne 1b
++ mov pc,lr //return
++
++TransmitChkSum:
++ add r9,r9,r0
++ b Transmit
++
++ .if STACKS_VALID
++// *******************************************************
++ RelocationVector 2
++// *******************************************************
++ .endif
++
++//OUT:
++//z-0 good data in r0
++//z-1 timeout, r0 is 0
++//r1 - loop cnt time remaining
++Receive:
++ mov r1,#RECEIVE_LOOP_COUNT
++Receive1:
++1: ldr r0,[rUart,#UART_LSR]
++ ands r0,r0,#0x1
++ ldrne r0,[rUart,#UART_RBR]
++ movne pc,lr //return
++
++ subs r1,r1,#1
++ bne 1b
++ mov pc,lr //return
++
++
++
++
++//IN: r2 - symbol #
++//OUT: r1:r0 - value,
++GetRegVal:
++ cmp r2,#SYM_FP0
++ bcs GetSpecialReg
++#if DBG_R0
++ add r1,rDBG,#DBG_R0
++ ldr r0,[r1,r2,LSL #2]
++#else
++ ldr r0,[rDBG,r2,LSL #2]
++#endif
++ mov r1,#0
++ mov pc,lr
++
++// ********************************************************************
++// ********************************************************************
++// ********************************************************************
++
++
++gdb_lastSignal:
++ ldrb r6,[rDBG,#DBG_LastSignal]
++ ldrb r5,[rDBG,#DBG_Mode]
++gdb_lastSignal1:
++ ldr r0,[rUart,#UART_LCR]
++ strb r0,[rDBG,#DBG_FFUART_LCR]
++ bic r0,r0,#0x80 //make sure DLAB is clear
++ str r0,[rUart,#UART_LCR]
++
++
++1: mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++// mov r0,#L1(T)
++ mov r0,#L1(S)
++ bl TransmitChkSum
++ mov r0,r6
++ bl PrintHexByteEndian
++// mov r0,#L1(F)
++// bl TransmitChkSum
++// mov r0,#L1(COLON)
++// bl TransmitChkSum
++// mov r2,#SYM_PC
++// bl GetRegVal
++// bl PrintHexEndian
++
++ mov r0,#L1(POUND)
++ bl Transmit
++ and r0,r9,#0xff
++ bl PrintHexByteEndian
++ mov r3,#0
++ mov r1,#RECEIVE_LOOP_COUNT
++10:
++ bl Receive1 //z-0 good data in r0, z-1 timeout, r0 is 0
++ moveq rNum1,#0
++ beq 12f //br if timeout
++ cmpne r6,#SIG_RESET //disable cr abort on power up
++// beq 10b //uncomment to stop <cr> from stopping
++
++ cmp r0,#L1(PLUS)
++ beq WaitForDollarSign
++ cmp r0,#L1(DOLLAR)
++ beq ReadGDB
++
++ cmp r0,#L1(MINUS)
++ beq 1b
++ tst r5,#1
++ cmpeq r0,#GDB_EXIT_CHAR
++ bne 10b //br if in GDB mode or NOT <cr>
++ mov rNum1,#1
++
++//r6 -SIG_xxx
++12:
++ bl TransmitCRLF
++ cmp r6,#SIG_DBG
++ BigMov r0,L4(D,B,G,MINUS)
++ blcs Transmit1
++
++ mov r2,#0
++ mov r3,#0
++ mov r4,#0
++ cmp r6,#SIG_RESET
++ cmpne r6,#SIG_DBG_RESET
++ BigMovEq r0,L4(R,e,s,e)
++ BigMovEq r2,L1(t)
++ cmp r6,#SIG_UNDEFINED_INSTRUCTION
++ BigMovEq r0,L4(U,n,d,e)
++ BigMovEq r2,L1(f)
++// BigMovEq r3,L1(d)
++ cmp r6,#SIG_SWI
++ BigMovEq r0,L3(S,w,i)
++ cmp r6,#SIG_PREFETCH_ABORT
++ BigMovEq r0,L4(P,r,e,f)
++ BigMovEq r2,L4(e,t,c,h)
++ cmp r6,#SIG_DATA_ABORT
++ BigMovEq r0,L4(D,a,t,a)
++ cmpne r6,#SIG_PREFETCH_ABORT
++ BigMovEq r3,L4(SPACE,A,b,o)
++ BigMovEq r4,L2(r,t)
++ cmp r6,#SIG_UNUSED
++ BigMovEq r0,L4(U,n,u,s)
++ BigMovEq r2,L2(e,d)
++ cmp r6,#SIG_IRQ
++ BigMovEq r0,L3(I,r,q)
++ cmp r6,#SIG_FIQ
++ BigMovEq r0,L3(F,i,q)
++ cmp r6,#SIG_DBG_INSTRUCTION_BKPT
++ BigMovEq r0,L4(I,n,s,t)
++ BigMovEq r2,L4(SPACE,B,r,k)
++ cmp r6,#SIG_DBG_DATA_BKPT
++ BigMovEq r0,L4(D,a,t,a)
++ BigMovEq r2,L4(SPACE,B,r,k)
++ cmp r6,#SIG_DBG_BKPT_SOFTWARE
++ BigMovEq r0,L4(B,k,p,t)
++ cmp r6,#SIG_DBG_EXTERNAL
++ BigMovEq r0,L4(E,x,t,e)
++ BigMovEq r2,L4(r,n,a,l)
++ cmp r6,#SIG_DBG_VECTOR_TRAP
++ BigMovEq r0,L4(V,e,c,t)
++ BigMovEq r2,L4(o,r,SPACE,T)
++ BigMovEq r3,L3(r,a,p)
++ cmp r6,#SIG_DBG_TRACE_BUFFER_FULL
++ BigMovEq r0,L4(T,r,a,c)
++ BigMovEq r2,L4(e,SPACE,F,u)
++ BigMovEq r3,L2(l,l)
++ cmp r6,#SIG_DBG_RESERVED
++ BigMovEq r0,L4(R,e,s,e)
++ BigMovEq r2,L4(r,v,e,d)
++
++ bl Transmit1
++ movs r0,r2
++ blne Transmit1
++ movs r0,r3
++ blne Transmit1
++ movs r0,r4
++ blne Transmit1
++
++ bl TransmitSPACE
++ mov r2,#SYM_PC
++ bl GetRegVal
++ bl PrintHex
++// bl TransmitSPACE
++ bl TransmitCRLF
++
++ rsbs r0,pc,#0x800
++ BigMov r0,FLASH_READ_CMD
++
++#if (PLATFORM_TYPE==NEONB)
++ BigMov r1,VIRTUAL_CS1 //remember, although instruction fetches are physical, data are still virtual
++#else
++ BigMov r1,VIRTUAL_CS0 //remember, although instruction fetches are physical, data are still virtual
++#endif
++ cmphs rUart,#0x41000000
++ strhs r0,[r1] //if (pc is in minicache) & (rUart is in virtual memory) then
++ //make sure flash is in read mode, we are almost off the minicache
++
++#if (PLATFORM_TYPE==NEONB)
++ adr lr,AfterPCPrint
++ add r1,r1,lr //virtual address of AfterPCPrint if in Linux for data fetch
++ cmp lr,#0x800
++ BigOrr2Eq lr,FLASH_BASE_ADDRESS //if in low part of CS0 flash, try CS1 flash
++ BigMov r0,0xe3a00055 //instruction mov r0,#55
++ cmp rUart,#0x41000000
++ movlo r1,lr //use physical address of AfterPCPrint for data fetch
++ ldr r2,[r1]
++ cmp r2,r0
++ moveq pc,lr //br if CS1 valid
++ b AfterPCPrint_error
++#else
++ b AfterPCPrint1
++#endif
++
++// ******************************************************************************************
++//A MAIN goal is for all the code above this point to fit into the 2k mini instruction cache
++//So that if difficult errors occur and the flash isn't functioning properly, we can
++//at least get the PC printed out before a crash.
++// ******************************************************************************************
++
++
++//IN: r2 - symbol #, z-1 if SYM_FP0
++//OUT: r1:r0 - value,
++GetSpecialReg:
++ bne 2f
++//MRA{<cond>} <RdLo>,<RdHi>,acc0
++ mra r0,r1,acc0
++ mov pc,lr
++
++ .if STACKS_VALID
++ .else
++//Must keep this aligned at 0x800 if Bal
++ mac_AfterPCPrint 1
++ .endif
++
++2: cmp r2,#SYM_FSR
++ CP15_FSR mrceq,r0
++ cmp r2,#SYM_FAR
++ CP15_FAR mrceq,r0
++ cmp r2,#SYM_DCSR
++ CP14_DCSR mrceq,r0
++ cmp r2,#SYM_TTBR
++ CP15_TTBR mrceq,r0
++ cmp r2,#SYM_CTRL
++ CP15_CONTROL mrceq,r0
++ mov r1,#0
++ mov pc,lr
++
++//out: c-1 means hex char, r0 - character read, r1 - 0:15 if r0 is a hex character
++ReadHex:
++1: ldr r0,[rUart,#UART_LSR]
++ ands r0,r0,#0x1
++ ldrne r0,[rUart,#UART_RBR]
++ beq 1b //br on timeout
++ rsbs r1,r0,#L1(9) //reverse subtract
++ subcss r1,r0,#L1(0)
++ movcs pc,lr
++
++ rsbs r1,r0,#L1(f) //reverse subtract
++ subcss r1,r0,#L1(a)
++ addcs r1,r1,#10
++
++ movcs pc,lr
++
++ rsbs r1,r0,#L1(F) //reverse subtract
++ subcss r1,r0,#L1(A)
++ addcs r1,r1,#10
++ mov pc,lr
++
++ .if STACKS_VALID
++//Must keep this aligned at 0x800 if Bal
++ mac_AfterPCPrint 0
++ .endif
++
++
++//r2:r1:r0 value to print, r9 - chksum
++PrintHexEndian12:
++ .if 1
++ orr r3,r0,r1
++ orrs r3,r3,r2
++ bne 1f
++ mov r3,lr
++ mov r0,#L1(0)
++ bl TransmitChkSum
++ mov r0,#L1(ASTERISK)
++ bl TransmitChkSum
++ mov r0,#29+24-1
++ mov lr,r3
++ b TransmitChkSum
++ .endif
++1:
++#if LITTLE_ENDIAN
++ mov r7,lr
++ mov r5,r1
++ mov r6,r2
++ bl PrintHexEndian //r0
++ mov r0,r5
++ bl PrintHexEndian //r1
++ mov r0,r6
++ mov lr,r7
++ b PrintHexEndian //r2
++
++#else
++ mov r7,lr
++ mov r5,r0
++ mov r6,r1
++ mov r0,r2
++ bl PrintHexEndian //r2
++ mov r0,r6
++ bl PrintHexEndian //r1
++ mov r0,r5
++ mov lr,r7
++ b PrintHexEndian //r0
++#endif
++
++
++MainInitializationCode:
++ cmp pc,#MEM_START
++ biclo sp,pc,#FLASH_BASE_ADDRESS
++ rsblos sp,sp,#0x4000
++ movlo r1,#0
++ blo InitializeCont2 //br if not ram and not from reset vector
++
++//pc - 0-0x4000, 0x04000000-0x04004000, 0xa000000-0xffffffff
++ InitCS0_CS1 r0,sp
++ InitGPIO r0,sp
++
++#if (PLATFORM_TYPE==NEONB)
++ adr lr,AfterPCPrint
++ cmp lr,#0x800
++ bne InitializeCont1
++ BigOrr2 lr,FLASH_BASE_ADDRESS //if in low part of CS0 flash, try CS1 flash
++ BigMov r0,0xe3a00055 //instruction mov r0,#55
++ ldr r2,[lr]
++ cmp r2,r0
++ addeq pc,lr,#InitializeCont-AfterPCPrint //br if CS1 valid
++#endif
++ b InitializeCont1
++
++//OUT: r0,r2 value, r7 trashed
++ReadHexEndian:
++ mov r3,lr
++ ReadHexE r2,r7
++ mov r0,r2
++ mov pc,r3
++
++
++//OUT: r2:r1:r0 value
++ReadHexEndian12:
++ mov r3,lr
++
++#if LITTLE_ENDIAN
++ ReadHexE r4,r7
++ ReadHexE r5,r7
++ ReadHexE r2,r7
++ mov r0,r4
++ mov r1,r5
++#else
++ ReadHexE r2,r7
++ ReadHexE r5,r7
++ ReadHexE r4,r7
++ mov r0,r4
++ mov r1,r5
++#endif
++ mov pc,r3
++
++
++
++ReadGDB:
++ mov r8,#0
++ mov r9,#0
++ mov rGdbNum3,#0
++ mov rGdbChkSum,#0
++1: bl Receive
++ beq 1b //br on timeout
++ cmp r0,#L1(G)
++ beq gdb_G
++// cmp r0,#L1(q)
++// beq gdb_q
++ mov rGdbCmd,r0 //r5 - command being requested
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ bl GetNumber
++ mov r6,r2
++ mov r7,r0
++ cmp r0,#L1(POUND)
++ beq 2f
++ cmp rGdbCmd,#L1(P)
++ beq gdb_P
++// cmp r0,#L1(COMMA)
++// cmpne r0,#L1(SEMICOLON)
++// cmpne r0,#L1(COLON)
++// cmpne r0,#L1(EQUAL)
++ bl GetNumber
++ mov r8,r2
++ mov r9,r0
++ cmp r0,#L1(POUND)
++ beq 2f
++ cmp rGdbCmd,#L1(M)
++ beq gdb_M
++ cmp rGdbCmd,#L1(X)
++ beq gdb_X
++
++ bl GetNumber
++ mov rGdbNum3,r2
++ cmp r0,#L1(POUND)
++ bne WaitForPound
++
++//# found, check chksum
++2: bl ReadChksum
++ and rGdbChkSum,rGdbChkSum,#0xff
++ cmp rGdbChkSum,r2
++ bne CheckSumError
++ mov r0,#L1(PLUS)
++ bl Transmit
++
++ cmp rGdbCmd,#L1(g)
++ beq gdb_g
++ cmp rGdbCmd,#L1(p)
++ beq gdb_p
++ cmp rGdbCmd,#L1(m)
++ beq gdb_m
++ cmp rGdbCmd,#L1(c)
++ beq gdb_c
++ cmp rGdbCmd,#L1(C)
++ beq gdb_C
++ cmp rGdbCmd,#L1(s)
++ beq gdb_s
++ cmp rGdbCmd,#L1(S)
++ beq gdb_S
++ cmp rGdbCmd,#L1(z)
++ beq gdb_z
++ cmp rGdbCmd,#L1(Z)
++ beq gdb_Z
++ cmp rGdbCmd,#L1(t)
++ beq gdb_t
++ cmp rGdbCmd,#L1(QUESTION_MARK)
++ beq gdb_lastSignal
++ cmp rGdbCmd,#L1(D)
++ beq gdb_D
++//this is an unimplemented command
++UnImplemented:
++ BigMov r0,L4(DOLLAR,POUND,0,0)
++ bl Transmit1
++ b WaitForDollarSign
++
++
++SendError01:
++ mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++ mov r0,#L1(E)
++ bl TransmitChkSum
++ mov r0,#L1(0)
++ bl TransmitChkSum
++ mov r0,#L1(1)
++ bl TransmitChkSum
++ sub r5,pc,#.+8-SendError01
++ b FinishPacket
++
++
++SendOK:
++ mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++ mov r0,#L1(O)
++ bl TransmitChkSum
++ mov r0,#L1(K)
++ bl TransmitChkSum
++ sub r5,pc,#.+8-SendOK
++ b FinishPacket
++
++CheckSumError:
++ mov r0,#L1(MINUS)
++ bl Transmit
++WaitForDollarSign:
++11: bl GetNumber //$ will branch to ReadGDB
++ b 11b
++WaitForPound:
++11: bl GetNumber
++ cmp r0,#L1(POUND)
++ bne 11b
++ bl ReadChksum
++ and rGdbChkSum,rGdbChkSum,#0xff
++ cmp rGdbChkSum,r2
++ bne CheckSumError
++ mov r0,#L1(PLUS)
++ bl Transmit
++ b UnImplemented
++
++
++
++FinishPacket:
++ mov r0,#L1(POUND)
++ bl Transmit
++ and r0,r9,#0xff
++ bl PrintHexByte
++10: mov r2,#5
++11: bl ReadHex
++ cmp r0,#L1(DOLLAR)
++ beq ReadGDB
++ cmp r0,#L1(PLUS)
++ beq WaitForDollarSign
++ cmp r0,#L1(MINUS)
++
++
++ moveq pc,r5 //retransmit packet
++ cmp r0,#GDB_EXIT_CHAR
++ bne 10b
++ subs r2,r2,#1
++ beq Prompt
++ b 11b
++
++ .if 0
++gdb_q:
++ mov r2,#0
++ mov r3,#0
++1: bl ReadHex
++ cmp r0,#L1(DOLLAR)
++ beq ReadGDB
++ cmp r0,#GDB_EXIT_CHAR
++ beq Prompt
++ cmp r0,#L1(POUND)
++ beq 2f
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ mov r1,r2,LSR #24
++ orr r3,r1,r3,LSL #8
++ orr r2,r0,r2,LSL #8
++ b 1b
++2:
++ bl ReadChksum
++ and rGdbChkSum,rGdbChkSum,#0xff
++ cmp rGdbChkSum,r2
++ bne CheckSumError
++ mov r0,#L1(PLUS)
++ bl Transmit
++ b UnImplemented
++ .endif
++
++
++//Detach command - gdb is exiting
++gdb_D:
++//clear break/watch points
++ b Prompt
++
++//r6 - addr, r8 - PP, rGdbNum3 - mm
++gdb_t:
++ b UnImplemented
++
++
++//read general registers
++gdb_g:
++ mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++ mov r8,#0
++1: mov r2,r8
++ bl GetRegVal
++ bl PrintHexEndian
++ add r8,r8,#1
++ cmp r8,#SYM_PC+1
++ bne 1b
++
++ mov r2,#SYM_FP0
++ bl GetRegVal
++ mov r8,#0
++2: mov r2,#0
++ bl PrintHexEndian12 //fp0-7
++ mov r0,#0
++ mov r1,#0
++ add r8,r8,#1
++ cmp r8,#8
++ bne 2b
++
++ bl PrintHexEndian //fps
++
++ mov r2,#SYM_CPSR
++ bl GetRegVal
++ bl PrintHexEndian //cpsr
++
++ sub r5,pc,#.+8-gdb_g
++ b FinishPacket
++
++
++//Read general register
++//r6 - reg #
++gdb_p:
++ mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++ mov r2,r6
++ cmp r6,#SYM_PC+1
++ bcs 2f
++
++1: bl GetRegVal
++3: bl PrintHexEndian
++4: sub r5,pc,#.+8-gdb_p
++ b FinishPacket
++2: cmp r6,#25
++ mov r2,#SYM_CPSR
++ beq 1b
++ cmp r6,#24 //fps
++ mov r0,#0
++ beq 3b
++ cmp r6,#16 //fp0
++ mov r0,#0
++ mov r1,#0
++ mov r2,#SYM_FP0
++ mov rGdbNum3,r6
++ bleq GetRegVal
++ mov r2,#0
++ bl PrintHexEndian12 //fp0-7
++ mov r6,rGdbNum3
++ b 4b
++
++//read memory
++//r6 - addr, r8 - length
++gdb_m:
++ mov r9,#0 //chksum
++ mov r0,#L1(DOLLAR)
++ bl Transmit
++ mov r5,r6
++ movs r7,r8
++ beq 4f
++1:
++ tst r5,#3
++ bne 3f
++ cmp r7,#4
++ bcc 3f
++ ldr r0,[r5],#4
++ bl PrintHexEndian
++ subs r7,r7,#4
++ bne 1b
++ b 4f
++
++3: ldrb r0,[r5],#1
++ bl PrintHexByteEndian
++ subs r7,r7,#1
++ bne 1b
++4: sub r5,pc,#.+8-gdb_m
++ b FinishPacket
++
++
++//continue
++//r6 - address, 0- current PC
++gdb_c:
++ mov r8,r6
++//r8 - address, 0- current PC
++gdb_C:
++ movs rNum1,r8
++ movne rValidCnt,#F_NUM1_MASK
++ moveq rValidCnt,#0
++ tst rNum1,#3
++ bne SendError01
++ mov r4,#1
++ b Go_Cmd1
++
++//step
++//r6 - address, 0- current PC
++gdb_s:
++ mov r8,r6
++//r8 - address, 0- current PC
++gdb_S:
++ movs rNum1,r8
++ movne rValidCnt,#F_NUM1_MASK
++ moveq rValidCnt,#0
++ tst rNum1,#3
++ bne SendError01
++ mov r4,#1
++ b Trace_Cmd1
++
++
++
++//watchpoints/breakpoints - remove
++//r6 - type, r8 - address
++gdb_z:
++ cmp r6,#0 //software breakpoint
++ cmpne r6,#1 //hardware breakpoint
++ bne UnImplemented
++// mov rNum1,r8 //same reg
++ bl BC_Do
++ b SendOK
++
++
++
++//watchpoints/breakpoints - insert
++gdb_Z:
++ cmp r6,#0 //software breakpoint
++ cmpne r6,#1 //hardware breakpoint
++ bne UnImplemented
++// mov rNum1,r8 //same reg
++ bl BS_Do // z-0 if r0==rNum1, breakpoint was already set
++ cmpne r0,rNum1
++ beq SendOK
++ b SendError01
++
++
++//gdb routines below have not done checksum yet
++//write general registers
++gdb_G:
++ mov r8,#0
++1: bl ReadHexEndian
++ mov r2,r8
++ mov r1,#0
++ bl StoreRegVal //r2 - symbol #, r1:r0 - value
++ add r8,r8,#1
++ cmp r8,#SYM_PC+1
++ bne 1b
++
++ bl ReadHexEndian12
++ mov r2,#SYM_FP0
++ bl StoreRegVal //r2 - symbol #, r1:r0 - value
++
++ mov r8,#1
++2: bl ReadHexEndian12
++ add r8,r8,#1
++ cmp r8,#8
++ bne 2b
++
++ bl ReadHexEndian //fps
++ bl ReadHexEndian //cpsr
++
++ mov r2,#SYM_CPSR
++ bl StoreRegVal //r2 - symbol #, r1:r0 - value
++FinishWritePacket:
++ bl FinishWriteP
++ b SendOK
++FinishWriteP:
++ mov r4,lr
++ bl ReadHex
++ cmp r0,#L1(POUND)
++ bne CheckSumError
++ bl ReadChksum
++ and rGdbChkSum,rGdbChkSum,#0xff
++ cmp rGdbChkSum,r2
++ bne CheckSumError
++ mov r0,#L1(PLUS)
++ bl Transmit
++ mov pc,r4
++
++
++
++
++//write general register
++//r6 - reg#
++gdb_P:
++ mov r8,r6
++ cmp r6,#SYM_PC+1
++ bcs 2f
++1:
++ bl ReadHexEndian
++4: mov r6,r0
++ mov r7,r1
++ bl FinishWriteP
++ mov r0,r6
++ mov r1,r7
++ mov r2,r8
++ bl StoreRegVal //r2 - symbol #, r1:r0 - value
++ b SendOK
++
++3: bl ReadHexEndian
++ b FinishWritePacket
++
++2: cmp r6,#25
++ mov r8,#SYM_CPSR
++ beq 1b
++ cmp r6,#24 //fps
++ beq 3b
++ bl ReadHexEndian12
++ cmp r6,#16 //fp0
++ bne FinishWritePacket
++ mov r8,#SYM_FP0
++ b 4b
++
++
++//write memory
++//r6 - addr, r8 - length
++gdb_M:
++ movs r8,r8
++ beq FinishWritePacket
++
++1: tst r6,#3
++ beq 3f
++2: bl ReadHexByteEndian
++ strb r2,[r6],#1
++ subs r8,r8,#1
++ bne 1b
++ b FinishWritePacket
++3: cmp r8,#4
++ bcc 2b
++ bl ReadHexEndian
++ str r2,[r6],#4
++ subs r8,r8,#4
++ bne 3b
++ b FinishWritePacket
++
++
++//write memory binary with 0x7d, "$","#", escaped with 0x7d
++//r6 - addr, r8 - length
++gdb_X:
++ movs r8,r8
++ beq FinishWritePacket
++
++1: tst r6,#3
++ beq 3f
++2: bl ReadByteEndian
++ strb r0,[r6],#1
++ subs r8,r8,#1
++ bne 1b
++ b FinishWritePacket
++3: cmp r8,#4
++ bcc 2b
++ bl ReadEndian
++ str r0,[r6],#4
++ subs r8,r8,#4
++ bne 3b
++ b FinishWritePacket
++
++
++
++ReadEndian:
++ mov r4,lr
++ mov r5,#4
++1: bl ReadByteEndian
++
++#if LITTLE_ENDIAN
++ mov r0,r0,LSL #24
++ orr r2,r0,r2,LSR #8
++#else
++ orr r2,r0,r2,LSL #8
++#endif
++
++ subs r5,r5,#1
++ bne 1b
++ mov r0,r2
++ mov pc,r4
++
++
++ReadByteEndian:
++ mov r3,lr
++ bl ReadHex
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ cmp r0,#0x7d
++ beq 1f
++ cmp r0,#L1(DOLLAR)
++ cmpne r0,#L1(POUND)
++ beq CheckSumError
++ mov pc,r3
++1:
++ bl ReadHex
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ mov pc,r3
++
++
++ReadHexByteEndian:
++ mov r3,lr
++ bl ReadHex
++ bcc CheckSumError
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ mov r2,r1
++ bl ReadHex
++ bcc CheckSumError
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ add r2,r1,r2,LSL #4
++ mov pc,r3
++
++//OUT: r2 - checksum
++ReadChksum:
++ mov r3,lr
++ bl ReadHex
++ movcs r2,r1
++ blcs ReadHex
++ addcs r2,r1,r2,LSL #4
++ mvncc r2,#0
++ mov pc,r3
++
++//out: r0 exit character, r2 - number, rGdbChkSum - updated
++GetNumber:
++ mov r2,#0
++ mov r3,lr
++1: bl ReadHex
++ bcc 3f
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++2: tst r2,#0xf0000000
++ movne pc,r3 //return on number overflow
++ add r2,r1,r2,LSL #4
++ b 1b
++3: cmp r0,#L1(DOLLAR)
++ beq ReadGDB
++ cmp r0,#GDB_EXIT_CHAR
++ beq Prompt
++ cmp r0,#L1(POUND)
++ addne rGdbChkSum,rGdbChkSum,r0 //update checksum
++ mov pc,r3
++
++// *****************************************************************
++#if (PLATFORM_TYPE==NEONB)
++AfterPCPrint_error:
++ bl TransmitCRLF
++ BigMov r0,L4(F,l,a,s)
++ bl Transmit1
++ BigMov r0,L4(h,SPACE,i,s)
++ bl Transmit1
++ BigMov r0,L4(SPACE,i,n,v)
++ bl Transmit1
++ BigMov r0,L4(a,l,i,d)
++ bl Transmit1
++ bl TransmitCRLF
++#endif
++AfterPCPrint1:
++ mov rPrevNum1,#MEM_START
++ movs rNum1,rNum1
++ tsteq r6,#7 //make sure it's a SIG_RESET, or SIG_DBG_RESET, and timeout
++ bne 1f
++ BigBic r0,pc,FLASH_BASE_ADDRESS
++ cmp r0,#0x4000
++ blo Gl_Cmd //auto start program if running in flash
++1:
++ b R_Cmd
++// b Prompt2
++
++
++Invalid:
++ bl TransmitCRLF
++ BigMov r0,L4(i,n,v,a)
++ bl Transmit1
++ BigMov r0,L3(l,i,d)
++ bl Transmit1
++ b Prompt
++Prompt1:
++ mov rPrevNum1,#MEM_START
++Prompt:
++1: bl TransmitCRLF
++Prompt2:
++ mov r0,#L1(PERIOD)
++ bl Transmit
++ bl TransmitSPACE
++ mov rFieldStart,#1
++ bl ReadCommand
++
++ mov r2,r0 //save exit character
++ cmp r0,#0x0d
++ blne Transmit
++ bl TransmitCRLF
++
++ cmp rCommand,#0
++ bne 2f
++ cmp r2,#0x0d
++ beq 1b
++ cmp r2,#L1(PLUS)
++ addeq rPrevNum1,rPrevNum1,#4
++ beq Examine_Cmd
++ cmp r2,#L1(MINUS)
++ subeq rPrevNum1,rPrevNum1,#4
++ beq Examine_Cmd
++ b 1b
++
++2: tst rSymbol,#F_NUM1_MASK
++ mov r0,rNum1
++ blne GetSymbolNumber
++ bne Invalid
++ mov rNum1,r0
++
++ tst rSymbol,#F_NUM2_MASK
++ mov r0,rNum2
++ blne GetSymbolNumber
++ bne Invalid
++ mov rNum2,r0
++
++ cmp rCommand,#L1(E)
++ beq Examine_Cmd
++ cmp rCommand,#L1(D)
++ beq Deposit_Cmd
++ cmp rCommand,#L1(G)
++ beq Go_Cmd
++ cmp rCommand,#L1(R)
++ beq R_Cmd
++ cmp rCommand,#L1(T)
++ beq Trace_Cmd
++ BigMov r0,C2(D,L)
++ cmp rCommand,r0
++ beq Download_Cmd
++ cmp rCommand,#L1(QUESTION_MARK)
++ beq Help_Cmd
++
++ mov r0,r0,LSL #8
++ orr r0,r0,#L1(W)
++ cmp rCommand,r0
++ beq Download_Wireless_Cmd
++
++ BigMov r0,C4(S,S,I,D)
++ cmp rCommand,r0
++ beq SSID_Cmd
++
++ BigMov r0,C3(M,A,C)
++ cmp rCommand,r0
++ beq MAC_Cmd
++
++ BigMov r0,C4(B,U,R,N)
++ cmp rCommand,r0
++ beq Burn_Cmd
++
++ BigMov r0,C2(B,B)
++ cmp rCommand,r0
++ beq Burn2_Cmd
++
++ BigMov r0,C4(B,A,L,L) //Burn all of flash, erase end.
++ cmp rCommand,r0
++ beq BurnAll_Cmd
++
++ cmp rCommand,#L1(V)
++ beq Verify_Cmd
++
++ BigMov r0,C2(V,V)
++ cmp rCommand,r0
++ beq Verify2_Cmd
++
++ BigMov r0,C2(G,L)
++ cmp rCommand,r0
++ beq Gl_Cmd //go linux!!
++
++ BigEor2 r0,C2(G,L)^C2(G,G)
++ cmp rCommand,r0
++ beq GG_Cmd //go without cache invalidate
++
++ BigMov r0,C2(T,T)
++ cmp rCommand,r0
++ beq TT_Cmd //Trace without cache invalidate
++
++ BigMov r0,C2(B,S)
++ cmp rCommand,r0
++ beq BS_Cmd
++
++ BigEor2 r0,C2(B,S)^C2(B,E)
++ cmp rCommand,r0
++ beq BE_Cmd
++
++ BigEor2 r0,C2(B,E)^C2(B,C)
++ cmp rCommand,r0
++ beq BC_Cmd
++
++ BigEor2 r0,C2(B,C)^C2(W,C)
++ cmp rCommand,r0
++ beq WC_Cmd
++
++ BigEor2 r0,C2(W,C)^C2(W,W)
++ cmp rCommand,r0
++ beq WW_Cmd
++
++ BigEor2 r0,C2(W,W)^C2(W,R)
++ cmp rCommand,r0
++ beq WR_Cmd
++
++ mov r0,r0,LSL #8
++ orr r0,r0,#L1(W)
++ cmp rCommand,r0
++ beq WRW_Cmd
++
++ BigMov r0,C3(M,M,U)
++ cmp rCommand,r0
++ beq MMU_Cmd
++// mov r0,rCommand
++// bl PrintHex
++ b Invalid
++
++//IN: rFieldStart - starting field (this is a blank counting field)
++//OUT:
++ReadCommand:
++ mov r3,lr
++ mov rSymbol,#0
++ mov rField,rFieldStart
++ mov rValidCnt,#0 //low nibble: # of blanks before command
++ //next: # of chars in command
++ //next: # of blanks
++ //next: # of hex digits in num1
++ //next: # of blanks
++ //next: # of hex digits in num2
++ mov rCommand,#0 //command
++ mov rNum1,#0 //1st number
++ mov rNum2,#0 //2nd number
++
++1: bl Receive
++ beq 1b //br on timeout
++ cmp r0,#L1(DOLLAR)
++ beq ReadGDB
++ cmp r0,#L1(PLUS)
++ cmpne r0,#L1(MINUS)
++ cmpne r0,#L1(AT_SIGN)
++ cmpeq rValidCnt,#0
++ cmpne r0,#0x0d
++ moveq pc,r3 //return on -,+, 1st on line or <cr>
++
++ cmp r0,#L1(SPACE)
++ bne 2f
++ bl Transmit
++ tst rValidCnt,#0x80000000
++ eorne rValidCnt,rValidCnt,#0x80000000 //clear bit 31 to mark as blank field
++ movne rField,rField,LSL #F_INC
++//now we are in a counting blanks field
++ rsb r2,rField,rField,LSL #F_INC //get a field mask
++ and r1,rValidCnt,r2
++ cmp r1,r2
++ beq Invalid //br if field is full
++ add rValidCnt,rValidCnt,rField
++ b 1b
++2:
++ cmp r0,#0x08 //Backspace
++ cmpne r0,#0x7f //del or Backspace
++ bne 4f
++ cmp rValidCnt,#0
++ beq 1b //br if nothing to remove
++ BigMov r0,L3(BACKSPACE,SPACE,BACKSPACE)
++ bl Transmit1
++ sub rValidCnt,rValidCnt,rField
++ mov r0,#4
++ tst rSymbol,rField
++ movne r0,#8
++ cmp rField,#F_COMMAND
++ moveq rCommand,rCommand,LSR #8
++ cmp rField,#F_NUM1
++ moveq rNum1,rNum1,LSR r0
++ cmp rField,#F_NUM2
++ moveq rNum2,rNum2,LSR r0
++
++3: rsb r0,rField,rField,LSL #F_INC //get a field mask
++ tst rValidCnt,r0
++ bne 1b //br if still more in this field
++ bic rSymbol,rSymbol,rField
++ cmp rField,rFieldStart
++ beq 1b
++//move back to lower field
++ mov rField,rField,LSR #F_INC
++ eors rValidCnt,rValidCnt,#0x80000000
++ b 3b
++
++4: bl Transmit
++ tst rValidCnt,#0x80000000
++ orreq rValidCnt,rValidCnt,#0x80000000 //set bit 31 to mark as data field
++ moveq rField,rField,LSL #F_INC
++ cmp rField,#F_UNDEF
++ beq Invalid
++//now we are in a data field
++ rsbs r1,rField,#F_COMMAND
++ rsbges r1,r0,#L1(9) //reverse subtract
++ subges r1,r0,#L1(0)
++ movge rField,rField,LSL #F_INC+F_INC //advance to number field if in range "0"-"9"
++
++ rsb r2,rField,rField,LSL #F_INC //get a field mask
++ and r1,rValidCnt,r2
++ cmp r1,r2
++ beq Invalid //field is full
++ add rValidCnt,rValidCnt,rField
++
++ rsbs r1,r0,#L1(z) //reverse subtract
++ subges r1,r0,#L1(a)
++ andge r0,r0,#0xdf //convert to uppercase if was "a"-"z"
++ cmp rField,#F_COMMAND
++ bne 6f
++ tst rCommand,#0xff000000
++ bne Invalid
++ add rCommand,r0,rCommand,LSL #8
++ b 1b
++
++6: tst rSymbol,rField
++ bne 15f
++ rsbs r1,r0,#L1(9) //reverse subtract
++ subges r1,r0,#L1(0)
++ bge 5f
++ rsbs r1,r0,#L1(F) //reverse subtract
++ subges r1,r0,#L1(A)
++ add r1,r1,#10
++ bge 5f
++ orr rSymbol,rSymbol,rField
++//now if number started with "A"-"F", convert back to ascii
++
++ cmp rField,#F_NUM1
++ mov r1,rValidCnt,LSR #F_NUM1_BIT //# of nibbles +1 in rNum
++ movne r1,rValidCnt,LSR #F_NUM2_BIT
++ and r1,r1,#((1<<F_INC)-1)
++
++ subs r1,r1,#1 //# of nibbles in rNum
++ beq 15f
++
++
++
++ cmp r1,#3
++ bcs Invalid //br if too many leading hex characters
++ mov r1,r1,LSL #2 //# of bits valid in rNum
++ cmp rField,#F_NUM1
++ rsb lr,r1,#24
++ moveq r2,rNum1,ROR r1
++ movne r2,rNum2,ROR r1
++ orr r2,r2,r0,LSL lr //save r0 character
++
++ mov lr,#0
++26: mov r0,r2,LSR #28
++ cmp r0,#10
++ addcs r0,r0,#L1(A)-10
++ addcc r0,r0,#L1(0)
++ orr lr,r0,lr,LSL #8
++ mov r2,r2,LSL #4
++ subs r1,r1,#4
++ bne 26b
++
++ cmp rField,#F_NUM1
++ mov r0,r2,LSR #24 //restore r0
++ moveq rNum1,lr
++ movne rNum2,lr
++ b 15f
++
++5:
++ cmp rField,#F_NUM1
++ bne 7f
++ tst rNum1,#0xf0000000
++ bne Invalid
++ add rNum1,r1,rNum1,LSL #4
++ b 1b
++7: tst rNum2,#0xf0000000
++ bne Invalid
++ add rNum2,r1,rNum2,LSL #4
++ b 1b
++
++15:
++ cmp rField,#F_NUM1
++ bne 17f
++ tst rNum1,#0xff000000
++ bne Invalid
++ add rNum1,r0,rNum1,LSL #8
++ b 1b
++17: tst rNum2,#0xff000000
++ bne Invalid
++ add rNum2,r0,rNum2,LSL #8
++ b 1b
++
++//rNum1 - 0 off, 1 on
++MMU_Cmd:
++ bl cache_clean_invalidate_all
++ tst rNum1,#1
++//now enable/disable MMU, Data Cache
++ CP15_CONTROL mrc,r1 //get the control register
++ biceq r1,r1,#0x5
++ orrne r1,r1,#0x5
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++ BigMov rUart,UART_BASE //this is right if MMU is off
++ blne GetUartAddress //if mmu is on
++ b Prompt
++
++// ********************************************************************
++// ********************************************************************
++// ********************************************************************
++// r3 - -1 : Trace, 0 : Go
++// r4 - 0 : normal, 1 : mark gdb mode
++// rNum2 - 0 : invalidate cache, 1 : don't invalidate cache
++//go without cache invalidate
++GG_Cmd:
++ mov r4,#0
++ mov r3,#0
++ mov rNum2,#1
++ b Go2
++Go_Cmd:
++ mov r4,#0
++Go_Cmd1:
++ mov r3,#0
++Go1:
++ bl cache_clean_invalidate_all
++ .if 0
++ mov rNum2,#0
++ .else
++ mov rNum2,#1
++ .endif
++Go2:
++
++ ldrb r2,[rDBG,#DBG_Mode]
++ and r2,r2,#0xfe
++ orr r2,r2,r4
++ strb r2,[rDBG,#DBG_Mode] //mark gdb mode
++
++ tst rValidCnt,#F_NUM1_MASK
++ strne rNum1,[rDBG,#DBG_PC] //return pc
++ ldreq rNum1,[rDBG,#DBG_PC] //return pc
++ orr r0,rNum1,#1
++ CP15_IBCR0 mrc,rBCR0
++ CP15_IBCR1 mrc,rBCR1
++ cmp r0,rBCR0
++ ldr r7,[rDBG,#DBG_CPSR]
++ mov r2,rBCR0 //save temporary
++ moveq rBCR0,#0
++ cmp r0,rBCR1
++ moveq rBCR1,#0
++
++ cmpne r0,r2
++ streq r0,[rDBG,#DBG_TRACE] //this is the current instruction breakpoint value
++ beq 4f //br if a bkpt matches current instruction
++ cmp r3,#0
++ str r3,[rDBG,#DBG_TRACE] //-1 : Trace, 0 : Go
++ beq 6f
++
++
++4: bl CalcNextPc //IN: rNum1: current PC, r7- cpsr; OUT: rNum1: next PC
++ tst r0,#1
++ bne Invalid
++ orr r1,r0,#1
++
++ tst rBCR0,#1
++ moveq rBCR0,r1
++ beq 5f
++ tst rBCR1,#1
++ moveq rBCR1,r1
++ strne rBCR0,[rDBG,#DBG_TRACE] //need to steal this breakpoint momentarily
++ movne rBCR0,r1
++5:
++ CP15_IBCR0 mcr,rBCR0
++ CP15_IBCR1 mcr,rBCR1
++
++6:
++ ldrb r0,[rDBG,#DBG_FFUART_LCR]
++ str r0,[rUart,#UART_LCR] //restore value
++ add r0,rDBG,#DBG_R2
++
++ bl ClearStickyAbort
++ BigMov r1,UART_BASE //physical address
++ movs rNum2,rNum2,LSR #1 //carry flag 1 : don't invalidate cache
++ teq r1,rUart //this lets me know if identity mapping is used, or MMU is off, C & V are not affected by instruction
++
++ ldmia r0,{r2,r3,r4,r5,r6,r7,r8,r9,sl,fp,ip,sp,lr}
++//z-0 return indirect, setup stack to contain real return address
++ ldrne r1,[r0,#DBG_PC-DBG_R2]
++ strne r1,[sp,#-4]!
++
++ ldr r1,[r0,#DBG_HCPSR-DBG_R2]
++ orr r1,r1,#0xc0 //set I, F
++ msr cpsr_c,r1
++// ldr r1,[r0,#DBG_CPSR-DBG_R2] //don't allow changing return mode for now... to messy
++// msr spsr,r1
++ CP15_CF_DRAIN mcr,r1 //make sure data cache write buffers are drained
++ b InvalidateAndReturn //z-1 return direct, z-0 return indirect
++
++
++
++ClearStickyAbort:
++ CP14_DCSR mrc,r1
++ tst r1,#1<<5
++ bic r1,r1,#1<<5 //clear sticky abort bit
++ CP14_DCSR mcrne,r1
++ mov pc,lr
++TT_Cmd:
++ mov r4,#0
++ mvn r3,#0
++ mov rNum2,#1
++ b Go2
++
++Trace_Cmd:
++ mov r4,#0
++Trace_Cmd1:
++ mvn r3,#0
++ b Go1
++
++
++//IN: rNum1: current PC, r7- cpsr
++//OUT: r0: next PC
++//trashed: r1,r2,r3,r4,r6
++CalcNextPc:
++ mov r4,lr
++ bl ClearStickyAbort
++ ldr r2,[rNum1]
++ add r0,rNum1,#4
++ nop //let abort have time to signal
++ bl ClearStickyAbort
++ movne pc,r4
++//1st check to see if condition codes allow instruction to execute
++1:
++ mov r3,r2,LSR #28
++ msr CPSR_f,r7
++ add pc,pc,r3,LSL #3
++ nop
++ beq 2f //0-eq
++ mov pc,r4
++ bne 2f //1-ne
++ mov pc,r4
++ bcs 2f //2-cs
++ mov pc,r4
++ bcc 2f //3-cc
++ mov pc,r4
++ bmi 2f //4-mi
++ mov pc,r4
++ bpl 2f //5-pl
++ mov pc,r4
++ bvs 2f //6-vs
++ mov pc,r4
++ bvc 2f //7-vc
++ mov pc,r4
++ bhi 2f //8-hi
++ mov pc,r4
++ bls 2f //9-ls
++ mov pc,r4
++ bge 2f //a-ge
++ mov pc,r4
++ blt 2f //b-lt
++ mov pc,r4
++ bgt 2f //c-gt
++ mov pc,r4
++ ble 2f //d-le
++ mov pc,r4
++ b 2f //e-al
++ mov pc,r4 //just a spacer instruction, never executed
++ //f-nv
++
++ and r3,r2,#0xfe000000
++ cmp r3,#0xfa000000
++ movne pc,r4
++//BLX instruction changing into thumb mode
++ movs r3,r2,LSL #8 //mov H bit to carry flag
++ orrcs r3,r3,#1<<7
++ add r0,r0,#4
++ add r0,r0,r3,ASR #6
++ mov pc,r4
++
++
++//instruction WILL execute
++2:
++ mov r3,r2,LSR #25
++ and r3,r3,#0x7
++ and r1,r2,#0x0000f000
++ cmp r1, #0x0000f000
++ mov r1,r2,LSL #20
++ mov r1,r1,LSR #20 //r1 gets low 12 bits of r2
++ add pc,pc,r3,LSL #2
++ nop
++ b 10f
++ b 11f
++ b 12f
++ b 13f
++ b 14f
++ b 15f
++ mov pc,r4 //6
++ mov pc,r4 //7
++//nnnn 000n
++10:
++ movne pc,r4
++ and r3,r2,#0x01800000
++ cmp r3, #0x01000000
++ bne 51f
++ and r3,r2,#0x0ff00000
++ cmp r3, #0x01200000
++ andeq r3,r2,#0x000000d0
++ cmpeq r3, #0x00000010
++//B{L} <Rm> instruction -eq
++ andeq r3,r2,#0xf
++#if DBG_R0
++ addeq r0,rDBG,#DBG_R0
++ ldreq r0,[r0,r3,LSL #2]
++#else
++ ldreq r0,[rDBG,r3,LSL #2]
++#endif
++
++ biceq r0,r0,#1
++ mov pc,r4
++
++
++51: tst r2,#1<<4
++ bne 52f
++ add r0,r0,#4 //pc+8
++ bl RegShiftImmed
++ b 50f
++52:
++ tst r2,#1<<7
++ movne pc,r4 //return if LDR|STR<H|D|B|SB|SH>|MUL|MLA...
++//this is a shift by a register value
++ add r0,r0,#4 //pc+8
++ bl RegShiftReg
++ b 50f
++
++//nnnn 001n immediate
++11:
++ movne pc,r4
++ and r3,r2,#0x01800000
++ cmp r3, #0x01000000
++ moveq pc,r4 //return if TST|TEQ|CMP|CMN|MRS|MSR|SMLA.....
++ and r6,r1,#0xff
++ mov r3,r1,LSR #7
++ BIC r3,r3,#1
++ mov r1,r6,ROR r3
++ add r0,r0,#4 //pc+8
++//r1 has 2nd operand
++50:
++ mov r3,r2,LSR #16
++ and r3,r3,#0xf
++ cmp r3,#0xf
++ moveq r6,r0 //pc+8
++#if DBG_R0
++ addne r6,rDBG,#DBG_R0
++ ldrne r6,[r6,r3,LSL #2] //<Rn> - r6
++#else
++ ldrne r6,[rDBG,r3,LSL #2] //<Rn> - r6
++#endif
++
++//r6 has 1st operand
++ mov r3,r2,LSR #21
++ and r3,r3,#0xf
++ msr CPSR_f,r7
++ add pc,pc,r3,LSL #3
++ nop
++ and r0,r6,r1 //0-AND
++ mov pc,r4
++ eor r0,r6,r1 //1-EOR
++ mov pc,r4
++ sub r0,r6,r1 //2-SUB
++ mov pc,r4
++ rsb r0,r6,r1 //3-RSB
++ mov pc,r4
++ add r0,r6,r1 //4-ADD
++ mov pc,r4
++ adc r0,r6,r1 //5-ADC
++ mov pc,r4
++ sbc r0,r6,r1 //6-SBC
++ mov pc,r4
++ rsc r0,r6,r1 //7-RSC
++ mov pc,r4
++ sub r0,r0,#4 //8-TST, cannot get here
++ mov pc,r4
++ sub r0,r0,#4 //9-TEQ, cannot get here
++ mov pc,r4
++ sub r0,r0,#4 //A-CMP, cannot get here
++ mov pc,r4
++ sub r0,r0,#4 //B-CMN, cannot get here
++ mov pc,r4
++ orr r0,r6,r1 //C-ORR
++ mov pc,r4
++ mov r0,r1 //D-MOV
++ mov pc,r4
++ bic r0,r6,r1 //E-BIC
++ mov pc,r4
++ mvn r0,r1 //F-MVN
++ mov pc,r4
++
++//LDR
++12:
++13:
++ tsteq r2,#1<<22 //B bit 22 1 : Byte, 0: Word
++ movne pc,r4
++ tst r2,#1<<20 //L bit 20 1 : LDR, 0:STR
++ moveq pc,r4
++
++ add r0,r0,#4 //pc+8
++ tst r2,#1<<24 //P bit
++ moveq r1,#0
++ beq 34f
++ tst r2,#1<<25
++ beq 34f //branch if immediate12bits value is in r1
++ bl RegShiftImmed
++34:
++ mov r3,r2,LSR #16
++ and r3,r3,#0xf
++ cmp r3,#0xf
++ moveq r6,r0 //pc+8
++#if DBG_R0
++ addne r6,rDBG,#DBG_R0
++ ldrne r6,[r6,r3,LSL #2] //<Rn> - r6
++#else
++ ldrne r6,[rDBG,r3,LSL #2] //<Rn> - r6
++#endif
++
++ tst r2,#1<<23 //U bit Up/Down, Add/Sub
++ addne r6,r6,r1
++ subeq r6,r6,r1
++ ldr r0,[r6]
++ mov pc,r4
++
++
++//LDM
++14:
++ and r3,r2,#(1<<15)+(1<<20)
++ cmp r3, #(1<<15)+(1<<20)
++ movne pc,r4
++
++//LDM to PC -eq
++ add r0,r0,#4 //pc+8
++ mov r3,r2,LSR #16
++ and r3,r3,#0xf
++ cmp r3,#0xf
++ moveq r1,r0 //pc+8, should never execute
++#if DBG_R0
++ addne r1,rDBG,#DBG_R0
++ ldrne r1,[r1,r3,LSL #2] //<Rn> - r1
++#else
++ ldrne r1,[rDBG,r3,LSL #2] //<Rn> - r1
++#endif
++
++//r1 is already correct address for downward from base (U==0), included(P==0)
++ tst r2,#1<<23 //U bit
++ beq 4f
++ mov r6,r2,LSL #16
++3: movs r6,r6,LSL #1
++ addcs r1,r1,#4
++ bne 3b
++ eor r2,r2,#1<<24
++4: tst r2,#1<<24 //P bit
++ subne r1,r1,#4
++ ldr r0,[r1]
++ mov pc,r4
++
++//B{L} instruction
++15:
++ mov r3,r2,LSL #8
++ add r0,r0,#4
++ add r0,r0,r3,ASR #6
++ mov pc,r4
++
++//IN: r0 - pc+4, r2 instruction, r1 low 12 bits of instruction
++//OUT: r1 - shifted value, r2 - unchanged, r0 - pc+8
++RegShiftImmed:
++ mov r1,r1,LSR #7 //Shift_imm - r1
++ and r3,r2,#0xf
++ cmp r3,#0xf
++ moveq r6,r0 //pc+8
++#if DBG_R0
++ addne r6,rDBG,#DBG_R0
++ ldrne r6,[r6,r3,LSL #2] //<Rm> - r6
++#else
++ ldrne r6,[rDBG,r3,LSL #2] //<Rm> - r6
++#endif
++
++ tst r2,#1<<6
++ bne 32f
++ tst r2,#1<<5
++ bne 31f
++ mov r1,r6,LSL r1 //<Rm> shf Shift_imm - r1
++ mov pc,lr
++
++31: cmp r1,#0
++ movne r1,r6,LSR r1
++ mov pc,lr
++
++32: tst r2,#1<<5
++ bne 33f
++ cmp r1,#0
++ moveq r1,#32
++ mov r1,r6,ASR r1
++ mov pc,lr
++
++33: cmp r1,#0
++ movne r1,r6,ROR r1
++ movne pc,lr
++
++ msr CPSR_f,r7
++ mov r1,r6, RRX
++ mov pc,lr
++
++
++//IN: r2 instruction, r1 low 12 bits of instruction
++//OUT: r1 - shifted value, r2 - unchanged, r0 - pc+8
++RegShiftReg:
++ mov r3,r1,LSR #8
++ cmp r3,#0xf
++ moveq r1,r0 //pc+8
++#if DBG_R0
++ addne r1,rDBG,#DBG_R0
++ ldrne r1,[r1,r3,LSL #2] //<Rs> - r1
++#else
++ ldrne r1,[rDBG,r3,LSL #2] //<Rs> - r1
++#endif
++
++ and r3,r2,#0xf
++ cmp r3,#0xf
++ moveq r6,r0 //pc+8
++#if DBG_R0
++ addne r6,rDBG,#DBG_R0
++ ldrne r6,[r6,r3,LSL #2] //<Rm> - r6
++#else
++ ldrne r6,[rDBG,r3,LSL #2] //<Rm> - r6
++#endif
++ tst r2,#1<<6
++ bne 32f
++ tst r2,#1<<5
++ moveq r1,r6,LSL r1 //<Rm> shf <Rs> - r1
++ movne r1,r6,LSR r1
++ mov pc,lr
++
++32: tst r2,#1<<5
++ moveq r1,r6,ASR r1
++ movne r1,r6,ROR r1
++ mov pc,lr
++
++
++
++//IN: r0 - register name
++//OUT: r0 - location
++GetSymbolNumber:
++ BigMov r1,C2(R,0)
++ sub r2,r0,r1
++ cmp r2,#10
++ bcc 1f
++
++ BigMov r1,C3(R,1,0)
++ sub r2,r0,r1
++ cmp r2,#6
++ bcc 2f
++
++ BigMov r1,C3(F,P,0)
++ cmp r1,r0
++ moveq r2,#SYM_FP0
++ beq 1f
++
++ BigMov r1,C2(S,L)
++ cmp r1,r0
++ moveq r2,#SYM_SL
++ beq 1f
++
++ BigMov r1,C2(F,P)
++ cmp r1,r0
++ moveq r2,#SYM_FP
++ beq 1f
++
++ BigEor2 r1,C2(F,P)^C2(I,P)
++ cmp r1,r0
++ moveq r2,#SYM_IP
++ beq 1f
++
++ BigEor2 r1,C2(I,P)^C2(S,P)
++ cmp r1,r0
++ moveq r2,#SYM_SP
++ beq 1f
++
++ BigMov r1,C2(L,R)
++ cmp r1,r0
++ moveq r2,#SYM_LR
++ beq 1f
++
++ BigMov r1,C2(P,C)
++ cmp r1,r0
++ moveq r2,#SYM_PC
++ beq 1f
++
++ BigMov r1,C4(C,P,S,R)
++ cmp r1,r0
++ moveq r2,#SYM_CPSR
++ beq 1f
++
++ BigMov r1,C3(F,S,R)
++ cmp r1,r0
++ moveq r2,#SYM_FSR
++ beq 1f
++
++ BigMov r1,C3(F,A,R)
++ cmp r1,r0
++ moveq r2,#SYM_FAR
++ beq 1f
++
++ BigMov r1,C4(D,C,S,R)
++ cmp r1,r0
++ moveq r2,#SYM_DCSR
++ beq 1f
++
++ BigMov r1,C4(T,T,B,R)
++ cmp r1,r0
++ moveq r2,#SYM_TTBR
++ beq 1f
++
++ BigMov r1,C4(C,T,R,L)
++ cmp r1,r0
++ moveq r2,#SYM_CTRL
++ beq 1f
++
++// BigMov r1,C3(F,P,S)
++// cmp r1,r0
++// moveq r2,#SYM_FPS-SYM_F0
++ movne pc,lr
++
++
++//3: add r2,r2,#SYM_F0-SYM_SL
++2: add r2,r2,#SYM_SL
++1: BigMov r0,DEBUG_SYM
++ add r0,r0,r2
++ subs r2,r2,r2
++ mov pc,lr
++
++
++
++//IN: r0 - symbol address or number to print
++PrintHexOrSymbol:
++ BigAdd r1,r0,-DEBUG_SYM
++ cmp r1,#SYM_LAST+1
++ bcs PrintHex
++ mov r0,#0
++
++//IN: r1 register #, r0 {31:16}- 2 characters to print after
++PrintRegName:
++ cmp r1,#SYM_SL
++ bcs 1f
++ add r0,r0,r1,LSL #8
++ add r0,r0,#L2(NULL,0)
++// cmp r1,#10
++// subge r0,r0,#10<<8
++// movge r0,r0,LSL #8
++// addge r0,r0,#L2(NULL,1)
++ add r0,r0,#L1(R)
++20: b Transmit1
++1: BigOrr2Eq r0,L2(S,L)
++ cmp r1,#SYM_FP
++ BigOrr2Eq r0,L2(F,P)
++ cmp r1,#SYM_IP
++ BigOrr2Eq r0,L2(I,P)
++ cmp r1,#SYM_SP
++ BigOrr2Eq r0,L2(S,P)
++ cmp r1,#SYM_LR
++ BigOrr2Eq r0,L2(L,R)
++ cmp r1,#SYM_PC
++ BigOrr2Eq r0,L2(P,C)
++ ble 20b
++ cmp r1,#SYM_FP0
++
++ mov r0,r0,LSL #8
++ BigOrr2Eq r0,L3(F,P,0)
++ cmp r1,#SYM_FSR
++ BigOrr2Eq r0,L3(F,S,R)
++ cmp r1,#SYM_FAR
++ BigOrr2Eq r0,L3(F,A,R)
++
++ cmp r1,#SYM_CPSR
++ BigMovEq r0,L4(C,P,S,R)
++ cmp r1,#SYM_DCSR
++ BigMovEq r0,L4(D,C,S,R)
++ cmp r1,#SYM_TTBR
++ BigMovEq r0,L4(T,T,B,R)
++ cmp r1,#SYM_CTRL
++ BigMovEq r0,L4(C,T,R,L)
++ b Transmit1
++
++
++//r2 - symbol #
++PrintRegVal:
++ mov r6,lr
++ bl GetRegVal
++ cmp r2,#SYM_FP0
++ bne 1f
++ mov r5,r0
++ mov r0,r1
++ bl PrintHexByte //40 bits
++ mov r0,r5
++1: mov lr,r6
++ b PrintHex
++
++
++
++
++
++//r2 - symbol #, r1:r0 - value
++StoreRegVal:
++ cmp r2,#SYM_FP0
++ bcs 1f
++#if DBG_R0
++ add r1,rDBG,#DBG_R0
++ str r0,[r1,r2,LSL #2]
++#else
++ str r0,[rDBG,r2,LSL #2]
++#endif
++ mov pc,lr
++1:
++ bne 2f
++//MAR{<cond>} acc0,<RdLo>,<RdHi>
++ mar acc0,r0,r1
++ mov pc,lr
++2: cmp r2,#SYM_FSR
++ CP15_FSR mcreq,r0
++ cmp r2,#SYM_FAR
++ CP15_FAR mcreq,r0
++ cmp r2,#SYM_DCSR
++ CP14_DCSR mcreq,r0
++ cmp r2,#SYM_TTBR
++ CP15_TTBR mcreq,r0
++ cmp r2,#SYM_CTRL
++ CP15_CONTROL mcreq,r0
++ mov pc,lr
++
++R_Cmd:
++ mov r7,#0
++1: mov r1,r7
++ BigMov r0,L4(NULL,NULL,COLON,SPACE)
++ bl PrintRegName
++ bl TransmitSPACE
++ mov r2,r7
++ bl PrintRegVal
++ bl TransmitSPACE
++ bl TransmitSPACE
++ add r7,r7,#1
++ tst r7,#3
++ bleq TransmitCRLF
++ cmp r7,#SYM_LAST_RCMD+1
++ bne 1b
++ b Prompt
++BS_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ beq BE_Cmd
++ tst rSymbol,#F_NUM1_MASK
++ mov r0,rNum1
++ blne GetSymValue
++ mov rNum1,r0
++ bl BS_Do
++ beq Prompt
++ b BE_Cmd
++
++//out: z-1 breakpoint just set
++// z-0 if r0==rNum1, breakpoint was already set
++BS_Do:
++ CP15_IBCR0 mrc,r0
++ CP15_IBCR1 mrc,r1
++ orr rNum1,rNum1,#1
++ cmp r0,rNum1
++ cmpne r1,rNum1
++ beq 2f
++ tst r0,#1
++ CP15_IBCR0 mcreq,rNum1
++ moveq pc,lr
++ tst r1,#1
++ CP15_IBCR1 mcreq,rNum1
++ mov pc,lr
++
++2: mov r0,rNum1
++ movs r1,#1
++ mov pc,lr
++
++BC_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ beq BE_Cmd
++ tst rSymbol,#F_NUM1_MASK
++ mov r0,rNum1
++ blne GetSymValue
++ mov rNum1,r0
++ bl BC_Do
++ beq Prompt
++ b BE_Cmd
++
++//out: z-1 breakpoint just cleared
++BC_Do:
++ CP15_IBCR0 mrc,r0
++ CP15_IBCR1 mrc,r1
++ orr rNum1,rNum1,#1
++ mov r2,#0
++ cmp r0,rNum1
++ CP15_IBCR0 mcreq,r2
++ cmp r1,rNum1
++ CP15_IBCR1 mcreq,r2
++ cmpne r0,rNum1
++ mov pc,lr
++
++BE_Cmd:
++ BigMov r0,L4(B,K,P,T)
++ bl Transmit1
++ bl TransmitSPACE
++ BigMov r0,L4(S,t,a,t)
++ bl Transmit1
++ BigMov r0,L4(u,s,COLON,SPACE)
++ bl Transmit1
++ CP15_IBCR0 mrc,r0
++ tst r0,#1
++ bic r0,r0,#1
++ blne PrintHex
++ bl TransmitSPACE
++
++ CP15_IBCR1 mrc,r0
++ tst r0,#1
++ bic r0,r0,#1
++ blne PrintHex
++ b Prompt
++
++WatchStatus:
++ BigMov r0,L4(W,A,T,C)
++ bl Transmit1
++ BigMov r0,L2(H,SPACE)
++ bl Transmit1
++ BigMov r0,L4(S,t,a,t)
++ bl Transmit1
++ BigMov r0,L4(u,s,COLON,SPACE)
++ bl Transmit1
++ CP15_DBCON mrc,r5
++ tst r5,#0x0f
++ beq 10f
++ tst r5,#0x03
++ bne 1f
++ tst r5,#0x100
++ bne 10f //br if dbr1 is mask (nothing being watched)
++ b 4f
++1:
++ CP15_DBR0 mrc,r0
++ bl PrintHex
++ bl 20f
++ tst r5,#0x100
++ beq 3f
++ BigMov r0,L2(M,COLON)
++ bl Transmit1
++ CP15_DBR1 mrc,r0 //read mask
++ bl PrintHex
++ b 10f
++3:
++ tst r5,#3<<2
++ beq 10f
++4:
++ CP15_DBR1 mrc,r0
++ bl PrintHex
++ mov r5,r5,LSR #2
++ bl 20f
++10: b Prompt
++
++
++20:
++ BigMov r0,L4(SPACE,R,W,SPACE)
++ tst r5,#1
++ beq 21f
++ tst r5,#2
++ BigEor2Eq r0,L4(SPACE,R,W,SPACE)^L4(SPACE,SPACE,W,SPACE) //store only
++ BigEor2Ne r0,L4(SPACE,R,W,SPACE)^L4(SPACE,R,SPACE,SPACE) //load only
++21:
++ b Transmit1
++
++WC_Cmd:
++ mov r0,#0
++ CP15_DBCON mcr,r0
++ b Prompt
++WRW_Cmd:
++ mov r4,#2
++ b WW_JOIN
++WR_Cmd:
++ mov r4,#3
++ b WW_JOIN
++WW_Cmd:
++ mov r4,#1
++WW_JOIN:
++ tst rValidCnt,#F_NUM1_MASK
++ beq WatchStatus
++ tst rSymbol,#F_NUM1_MASK
++ mov r0,rNum1
++ blne GetSymValue
++ mov rNum1,r0
++
++ tst rValidCnt,#F_NUM2_MASK
++ beq 3f
++ tst rSymbol,#F_NUM2_MASK
++ mov r0,rNum2
++ blne GetSymValue
++ mov rNum2,r0
++ orr r4,r4,#0x100 //mask
++1:
++ mov r0,#0
++ CP15_DBCON mcr,r0
++ CP15_DBR0 mcr,rNum1
++ CP15_DBR1 mcr,rNum2
++2:
++ CP15_DBCON mcr,r4
++ b Prompt
++3:
++ CP15_DBCON mrc,r5
++ mov rNum2,#0
++ tst r5,#0x100
++ bne 1b //br if mask was used previously
++ tst r5,#0x0f
++ beq 1b
++ mov r0,#0
++ CP15_DBCON mcr,r0
++ tst r5,#3
++ orreq r4,r5,r4
++ bicne r5,r5,#3<<2
++ orrne r4,r5,r4,LSL #2
++ CP15_DBR0 mcreq,rNum1
++ CP15_DBR1 mcrne,rNum1
++ b 2b
++
++
++//IN: rNum2 address
++//OUT: r1:r0 val
++GetSymValue:
++ BigAdd r2,rNum2,-DEBUG_SYM
++ cmp r2,#SYM_LAST+1
++ bcc GetRegVal
++ mov r0,rNum2
++ mov r1,#0
++ mov pc,lr
++//IN: rPrevNum1 address or symbol
++//OUT: r1:r0 val
++GetValue:
++ BigAdd r2,rPrevNum1,-DEBUG_SYM
++ cmp r2,#SYM_LAST+1
++ bcc GetRegVal
++ ldr r0,[rPrevNum1]
++ mov r1,#0
++ mov pc,lr
++
++
++//IN: rNum1 address
++PrintLocationOrRegVal:
++ BigAdd r2,rNum1,-DEBUG_SYM
++ cmp r2,#SYM_LAST+1
++ bcc PrintRegVal
++ tst r5,#3
++ tsteq rNum1,#3
++ bne 1f
++ ldr r0,[rNum1]
++ b PrintHex
++1: ldrb r0,[rNum1]
++ b PrintHexByte
++
++//IN: rPrevNum1 address, r1:r0 - value
++StoreLocationOrReg:
++ BigAdd r2,rPrevNum1,-DEBUG_SYM
++ cmp r2,#SYM_LAST+1
++ bcc StoreRegVal
++ tst r5,#3
++ tsteq rPrevNum1,#3
++ bne 1f
++ str r0,[rPrevNum1]
++ mov pc,lr
++1: strb r0,[rPrevNum1]
++ mov pc,lr
++
++GetChangeAmount:
++ BigAdd r0,rPrevNum1,-DEBUG_SYM
++ cmp r0,#SYM_LAST+1
++ movcs r0,#4
++ movcc r0,#1
++ tst r5,#3
++// tsteq rPrevNum1,#3
++ movne r0,#1
++ mov pc,lr
++
++Examine_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ moveq rNum1,rPrevNum1
++ movne rPrevNum1,rNum1
++ mov r5,rNum1
++ tst rValidCnt,#F_NUM2_MASK
++ bne 12f
++1: mov r0,rNum1
++ bl PrintHexOrSymbol
++ mov r0,#L1(FSLASH)
++ bl Transmit
++
++ bl PrintLocationOrRegVal
++
++ bl TransmitSPACE
++ mov rFieldStart,#1<<(F_INC+F_INC+F_INC+F_INC) //blank before num2 field
++ str r5,[rDBG,#DBG_TEMP]
++ bl ReadCommand
++ ldr r5,[rDBG,#DBG_TEMP]
++ mov r3,r0 //save exit character
++ mov r0,rNum2
++ mov r1,#0
++ tst rSymbol,#F_NUM2_MASK
++ beq 20f
++ blne GetSymbolNumber
++ bne Invalid
++ mov rNum2,r0
++ bl GetSymValue
++
++20:
++ cmp r3,#L1(PLUS)
++ cmpne r3,#L1(MINUS)
++ cmpne r3,#L1(AT_SIGN)
++ beq 2f
++ tst rValidCnt,#F_NUM2_MASK
++ beq Prompt
++ bl StoreLocationOrReg
++ mov r3,#L1(PLUS)
++ b 3f
++
++2: mov r0,r3
++ bl Transmit
++3: bl TransmitCRLF
++ bl GetChangeAmount
++ cmp r3,#L1(AT_SIGN)
++ beq 5f
++ cmp r3,#L1(PLUS)
++ addeq rPrevNum1,rPrevNum1,r0
++ subne rPrevNum1,rPrevNum1,r0
++4: mov rNum1,rPrevNum1
++ b 1b
++
++5: bl GetValue
++ mov rPrevNum1,r0
++ mov r5,r0
++ b 4b
++
++11: sub r0,rNum1,r5
++ cmp r0,#0x1000
++ bhs Prompt //no more than 128 lines per examine command
++ bl TransmitCRLF
++12: mov r0,rNum1
++ bl PrintHexOrSymbol
++ mov r0,#L1(FSLASH)
++ bl Transmit
++13:
++ bl GetChangeAmount
++ bcc 14f
++ add r0,rNum1,#3
++ cmp r0,rNum2
++ bhi 16f
++ tst r5,#3
++ tsteq rNum1,#3
++ bne 16f
++14: bl PrintLocationOrRegVal
++ bl GetChangeAmount
++15: add rNum1,rNum1,r0
++ cmp rNum1,rNum2
++ bhi Prompt
++ tst rNum1,#0x1f
++ beq 11b
++ bl TransmitSPACE
++ tst rNum1,#0x0f
++ bleq TransmitSPACE
++ b 13b
++16:
++ ldrb r0,[rNum1]
++ bl PrintHexByte
++ mov r0,#1
++ b 15b
++
++Deposit_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ beq Invalid
++ tst rValidCnt,#F_NUM2_MASK
++ beq Invalid
++ mov r0,rNum2
++ mov r1,#0
++ tst rSymbol,#F_NUM2_MASK
++ blne GetSymValue
++ mov rPrevNum1,rNum1
++ bl StoreLocationOrReg
++ b Prompt
++
++
++Download_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ beq Invalid
++ tst rNum1,#3
++ bne Invalid
++ cmp rNum1,#MEM_START
++ bcc Invalid //br if rNum1 is below ram start,
++ //NOTE: arm sets the carry to the opposite of most processors on subtract, compare
++
++ mov rDest,rNum1
++ mov rDestHead,rNum1
++ mov rPrevNum1,rNum1
++ mov rPrevCRC,#0
++ mov rRunningCRC,#0
++ mov rNak,#L1(C) //current NAK character
++ mov rBlockNum,#1 //block # to receive
++
++#if DDEBUG
++ b 47f
++91:
++ cmp rBlockNum,#1
++ beq 47f
++ mov r2,#L1(1)
++ b 45f
++92:
++ mov r2,#L1(2)
++ b 45f
++93:
++ mov r2,#L1(3)
++ b 45f
++94:
++ mov r2,#L1(4)
++ b 45f
++95:
++ mov r2,#L1(5)
++45:
++ BigMov r0,L3(CAN,CAN,CAN) //abort
++ bl Transmit1
++46: bl Receive
++ bne 46b //branch until timeout
++ mov r0,r2
++ bl Transmit
++ b Invalid
++#else
++91:
++92:
++93:
++94:
++95:
++#endif
++
++47:
++
++ mov r0,rNak
++15:
++ bl Transmit
++2: bl Receive
++ beq 91b //branch on timeout
++
++ mov rPacketLength,#128-1
++ cmp r0,#SOH
++ addne rPacketLength,rPacketLength,#1024-1-(128-1)
++ cmpne r0,#STX
++ beq 3f
++ cmp r0,#CAN
++ bne 16f
++ bl Receive
++ cmp r0,#CAN
++ bne 10f
++ b Invalid
++16: cmp r0,#EOT
++ bne 10f
++ mov r0,#ACK
++ bl Transmit
++
++#if DDEBUG
++ mov rDestHead,rDest
++ mov r0,rDest
++ bl PrintHex
++ bl TransmitSPACE
++ mov r0,rBlockNum
++ bl PrintHex
++
++ bl TransmitSPACE
++ mov r0,rRunningCRC
++ bl PrintHex
++ mov rDest,rDestHead
++#endif
++
++// now verify that ram is STILL valid by recomputing the CRC
++ mov rCRC,#0
++ mov r1,rPrevNum1
++ b 83f
++82:
++ ldrb r0,[r1],#1
++//
++ eor r0,rCRC,r0,LSL #24
++ eor r0,r0,r0,LSR #4 //c is in high byte of r0
++ and r0,r0,#0xff000000
++
++ mov rCRC,rCRC,LSL #8
++ eor rCRC,rCRC,r0,LSL #4
++ orr rCRC,rCRC,r0,LSR #8
++
++ eor rCRC,rCRC,r0,LSR #3
++//
++83: cmp r1,rDest
++ bne 82b
++#if DDEBUG
++ bl TransmitSPACE
++ mov r0,rCRC
++ bl PrintHex
++#endif
++
++ cmp rCRC,rRunningCRC
++ bne 84f
++ BigMov r0,L3(O,K,SPACE)
++ bl Transmit1
++ mov r0,rPrevNum1
++ mov rDestHead,rDest
++ bl PrintHex
++ mov r0,#L1(MINUS)
++ bl Transmit
++ mov r0,rDestHead
++ bl PrintHex
++ b Prompt
++84:
++ BigMov r0,L4(E,R,R,O)
++ bl Transmit1
++ mov r0,#L1(R)
++ bl Transmit
++ b Prompt
++
++3: bl Receive
++ beq 92b
++ mov r2,r0
++ bl Receive
++ beq 93b
++ eor r0,r0,#0xff
++ cmp r0,r2 //check 1's complement blk #
++ bne 10f
++ cmp r2,rBlockNum //check blk #
++ bne 20f
++80:
++ mov rDestHead,rDest //rDestHead - start of buffer, rDest end of buffer
++ mov rPrevCRC,rRunningCRC
++ mov rCRC,#0 //crc
++
++//alternative CRC calculation routines
++ .if 0
++ BigMov r2,CRC_POLY
++4: bl Receive
++ beq 8f //branch on timeout
++ eor rCRC,rCRC,r0,LSL #24
++ mov r1,#8
++5:
++ movs rCRC,rCRC,LSL #1
++ eorcs rCRC,rCRC,r2
++ subs r1,r1,#1
++ bne 5b
++ strb r0,[rDest],#1
++ subs rPacketLength,rPacketLength,#1
++ bge 4b
++ mov rCRC,rCRC,LSR #16 //CRC was only in the high half
++
++ .endif
++
++
++
++ .if 1
++4: bl Receive
++ beq 8f //branch on timeout
++//
++//calculate CRC
++//unsigned int crc = 0;
++//unsigned int c = 0;
++//for (i=3; i<max; i++)
++//{
++// c = crc ^ (buf[i]<<24);
++// c ^= (c >> 4);
++// c &= 0xff000000;
++// crc = (((crc<<8) ^ (c << 4)) | (c>>8)) ^ (c >> 3);
++//}
++//crc >>= 16;
++//
++ eor r1,rCRC,r0,LSL #24
++ eor r1,r1,r1,LSR #4
++ and r1,r1,#0xff000000
++
++ mov rCRC,rCRC,LSL #8
++ eor rCRC,rCRC,r1,LSL #4
++ orr rCRC,rCRC,r1,LSR #8
++ eor rCRC,rCRC,r1,LSR #3
++
++//also save a running total CRC to use to verify RAM after download is complete
++//
++ eor r1,rRunningCRC,r0,LSL #24
++ eor r1,r1,r1,LSR #4 //c is in high byte of r1
++ and r1,r1,#0xff000000
++
++ mov rRunningCRC,rRunningCRC,LSL #8
++ eor rRunningCRC,rRunningCRC,r1,LSL #4
++ orr rRunningCRC,rRunningCRC,r1,LSR #8
++
++ eor rRunningCRC,rRunningCRC,r1,LSR #3
++//
++#if LITTLE_ENDIAN
++ mov r0,r0,LSL #24
++ orr r2,r0,r2,LSR #8 //this assumes a little endian memory system
++#else
++ orr r2,r0,r2,LSL #8 //this assumes a big endian memory system
++#endif
++
++ tst rPacketLength,#3
++ streq r2,[rDest],#4
++ subs rPacketLength,rPacketLength,#1
++ bge 4b
++ mov rCRC,rCRC,LSR #16 //CRC was only in the high half
++ .endif
++
++
++
++
++ bl Receive
++ beq 8f //branch on timeout
++ mov r2,r0
++ bl Receive
++ beq 8f //branch on timeout
++ add r2,r0,r2,LSL #8
++ cmp rCRC,r2
++ bne 9f //branch on crc mismatch
++//packet is good
++ add rBlockNum,rBlockNum,#1
++ and rBlockNum,rBlockNum,#0xff
++ mov rNak,#NAK
++ mov r0,#ACK
++ b 15b
++20:
++ sub r1,rBlockNum,#1
++ and r1,r1,#0xff
++ cmp r1,r2
++ bne 21f //br if not trying to transmit the packet I just ACKed
++ mov rDest,rDestHead //reset pointer to previous packet
++ mov rRunningCRC,rPrevCRC
++ mov rBlockNum,r1 //correct blk #
++ b 80b
++
++21: BigMov r0,L3(CAN,CAN,CAN) //abort code
++ bl Transmit1
++48: bl Receive
++ bne 48b //branch until timeout
++
++#if DDEBUG
++ mov r0,r2
++ bl PrintHex
++ bl TransmitSPACE
++ mov r0,rBlockNum
++ bl PrintHex
++#endif
++
++ b Invalid //give up
++
++
++8: mov rDest,rDestHead //reset register
++ mov rRunningCRC,rPrevCRC
++ b 94b //send NAK
++9:
++#if DDEBUG //debug code
++ BigMov r0,L3(CAN,CAN,CAN) //abort code
++ bl Transmit1
++44: bl Receive
++ bne 44b //branch until timeout
++ mov r0,r2
++ bl PrintHex
++ bl TransmitSPACE
++ mov r0,rCRC
++ bl PrintHex
++ b Invalid
++#endif
++
++ mov rDest,rDestHead
++ mov rRunningCRC,rPrevCRC
++
++
++10: bl Receive
++ bne 10b //branch until timeout
++ b 95b //send NAK and wait for packet
++
++
++
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++//Code above this point must fit in 2k mini cache or be burned on flash
++//
++//Code below this point need not be in the 2k mini-instruction cache,
++//it can be temporarily placed in the main instruction cache unlocked
++// *******************************************************************************************
++
++InitializeCont1:
++//pc - 0-0x4000, 0x04000000-0x04004000, 0xa000000-0xffffffff
++ InitIC_Clocks r0,sp
++ InitUART r0,sp,FFUART_BASE,BAUDRATE
++ InitUART r0,sp,BTUART_BASE,BAUDRATE
++ InitUART r0,sp,STUART_BASE,9600
++ InitChangeCPUSpeed r0
++ InitMemory r0,sp,r1
++ BigMov r1,MACH_TYPE_SCANPASS
++ SaveRegisters r0,sp
++// *******************************************************
++ InitMMU r0
++ InitPWR r0,r1,sp //out: r1 RCSR
++InitializeCont2:
++ cmp pc,#MEM_START
++ bhs 89f //if in ram, must be mdebug
++ bic sp,pc,#FLASH_BASE_ADDRESS
++ cmp sp,#0x4000
++ mov r2,#FUNC_REQ_GL
++ bhs 87f //br if not part of reset vector
++ tst r1,#RCSR_SLEEP_RESET
++ beq 89f //; Not sleep.
++ mov r2,#FUNC_REQ_WAKEUP
++87: adr r7,88f
++ adr lr,89f
++ mov r10,r1 //RCSR
++ b TryRoutine1
++88: ldmia sp,{rPrevNum1,rUart,rDBG}
++89:
++ mov r2,lr
++ bl CalcMemEnd
++ mov r3,r0
++ mov lr,r2
++// *******************************************************
++//0xnnnn0000 - 16k remapping of flash address 0 for relocated vector table
++//0xnnnn4000 - 16k 16k 1st level descriptors table
++//0xnnnn8000 - 16k 2 x 1k 2nd level descriptor tables
++//0xnnnnc000 - 16k 12k skipped, 4k debug data
++//end of ram
++ BigSub sp,r3,0x8000
++ sub r2,sp,#0x4000
++ mov r1,r2
++ BigMov r0,0x0402 //section descriptor, ap-01, privileged r/w
++ //map virt to phys 1-to-1, non-cache, non-bufferable
++1: str r0,[r2],#4
++ add r0,r0,#1<<20
++ cmp r2,sp
++ bne 1b
++
++
++ add sp,r1,r3,LSR #(20-2)
++ add r1,r1,#((MEM_START>>20)&0xfff)<<2 //microsoft assembler bug propagates the sign bit
++ BigMov r0,(MEM_START&0xfff00000)+0x040A //cacheable (write through)
++2: str r0,[r1],#4
++ cmp r1,sp
++ addne r0,r0,#1<<20
++ bne 2b
++//r0 is physical address of last meg of memory
++ orr r1,r2,#1 //2nd level descriptor address (1k boundary), coarse page table
++
++ .ifdef __ARMASM
++ GBLA TABLE_CNT
++ .endif
++ .if ((DEBUG_START&0xfff00000) - (0xffff0000&0xfff00000))
++ .set TABLE_CNT,2
++ str r1,[r2,#((DEBUG_START>>18)&0x3ffc)-0x4000] //r2 is the end of the 16k table
++ add r1,r1,#0x400
++
++ .else
++ .set TABLE_CNT,1
++ .endif
++
++ str r1,[r2,#-4] //map (0xfff00000) to 2nd level page table
++ //last meg of memory (contains relocated reset vector)
++ add sp,r2,#((256*TABLE_CNT)-16)<<2 //256 - 4byte entries each mapping 4k
++
++//clear out 1 or 2 level 2 page tables
++ mov r1,#0
++3: str r1,[r2],#4
++ cmp r2,sp
++ bne 3b
++
++
++ BigMov r1,0x559 //map to flash in 1 - 64k page
++ add sp,sp,#16<<2
++4: str r1,[r2],#4
++ cmp r2,sp
++ bne 4b
++
++ bic r0,r0,#0x000ff
++ orr r0,r0,#0x0000e //cacheable writeback 4k page
++// orr r0,r0,#0x0000a //cacheable writethru 4k page
++ orr r0,r0,#0x00aa0 //privileged r/w, user read
++ orr r0,r0,#0xff000 //last 4k of ram
++
++ str r0,[r2,#((DEBUG_START>>10)&0x3fc)-(TABLE_CNT*0x400)] //debug variables, r2 is end of 1k tables
++
++ BigMov r0,0xffffffff
++ CP15_DACR mcr,r0
++
++ BigSub r0,r3,0xc000 //MEM_END-0xc000
++ CP15_TTBR mcr,r0
++//enable MMU
++ CP15_TLB_UNLOCK_I mcr,r0
++ CP15_TLB_UNLOCK_D mcr,r0
++ CP15_TLB_INVAL_BOTH mcr,r0
++
++ CP15_CONTROL mrc,r1 //get the control register
++ orr r1,r1,#0x1 //set bit 0 - enable MMU
++ CPWAIT r0
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++//enable the instruction cache
++ CP15_CF_UNLOCK_I mcr,r0
++// CP15_CF_INVAL_I mcr,r0 //I might be running from cache only, don't invalidate
++
++ orr r1,r1,#0x1000 //set bit 12 -- the I bit
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++//enable the data cache
++ CP15_CF_UNLOCK_D mcr,r0
++ CP15_CF_INVAL_D mcr,r0 //this will also drain write buffer
++ CP15_CF_DRAIN mcr,r0 //make sure it is drained just to be very safe
++
++ orr r1,r1,#0x4 //set bit 4 -- the D bit
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++ .if 0
++//if not in halt mode, lock 64k of flash remap in instruction TLB(contains override relocated vector table)
++//halt mode uses the mini cache and physical addresses only for this
++ CP14_DCSR mrc,r0
++ BigMov r1,0xffff0000
++ tst r0,#0x40000000
++//I am currently executing from flash, marked as uncacheable
++ CP15_TLB_LOCK_IENTRY mcreq,r1 //lock 64k if not in halt mode
++ CPWAIT r0
++ .endif
++
++//now lock debug data into data cache
++ BigMov r1,DEBUG_START
++ mov r2,#DEBUG_SPACE>>5 //3 or 4 cache lines to lock
++ CP15_TLB_LOCK_DENTRY mcr,r1
++ mov sp,#1
++ CP15_CF_LOCK_D_CSR mcr,sp //data cache is into lock mode
++ CPWAIT r0
++5: pld [r1]
++ add r1,r1,#32 //lock and load
++ CP15_CF_DRAIN mcr,r0
++ subs r2,r2,#1
++ bne 5b
++
++ mov sp,#0
++ CP15_CF_LOCK_D_CSR mcr,sp //data cache is out of lock mode
++ CPWAIT r0
++
++ BigMov r0,0x3fff
++ CP15_CP_ACCESS mcr,r0 //enable access to all coprocessors
++//now disable MMU, Data Cache
++ .if 1
++ CP15_CONTROL mrc,r1 //get the control register
++ bic r1,r1,#0x5
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++ .endif
++#if (DO_GPTEST==0)
++// TransMacro L1(U)
++
++#if (PLATFORM_TYPE==BD2003) || (PLATFORM_TYPE==BOUNDARY_OLD_BOARD) || (PLATFORM_TYPE==OLD_GAME_CONTROLLER) || (PLATFORM_TYPE==HALOGEN)
++ sub r0,r3,#0x100000 //last meg-8k for video ram
++ sub r1,r3,#0x2000 //8K from end, last 4k is debug variables
++ str r1,[r1,#FDESC_FDADR] //next frame descriptor address, loop to self
++ str r0,[r1,#FDESC_FSADR] //start of frame
++ str r0,[r1,#FDESC_FIDR] //id of frame, anything I want
++ BigMov r2,SCREEN_WIDTH*SCREEN_HEIGHT*BYTES_PER_PIXEL
++ str r2,[r1,#FDESC_DCMD] //length of dma transfer
++
++#if (BYTES_PER_PIXEL==2)
++ BigMov sp,(BLUE_VAL<<0)+(GREEN_VAL<<5)+(RED_VAL<<11) //rgb value
++ orr sp,sp,sp,LSL #16
++79: str sp,[r0],#4
++ subs r2,r2,#4
++ bne 79b
++#else
++ BigMov r1,(BLUE_VAL<<0)+(GREEN_VAL<<6)+(RED_VAL<<12) //rgb value
++ orr r1,r1,r1,LSL #24
++
++ mov sp,r1,LSR #8
++ orr sp,sp,sp,LSL #24
++
++ mov lr,sp,LSR #8
++ orr lr,lr,lr,LSL #24
++79: stmia r0!,{r1,sp,lr}
++ subs r2,r2,#12
++ bne 79b
++ sub r1,r3,#0x2000 //8K from end, last 4k is debug variables
++#endif
++
++ InitLCD r0,sp,r1 //r1 has descriptor address
++#endif
++
++
++// ****************************
++ mrs r1, CPSR
++ bic r2, r1,#PSR_MODE_MASK
++ orr r0, r2,#PSR_NOINTS_MASK+PSR_MODE_SVC //change to supervisor stack
++ msr CPSR_c, r0
++ BigMov r0,SS_START+SS_SUPERVISOR
++ mov sp, r0
++
++ orr r2, r2, #PSR_NOINTS_MASK+PSR_MODE_IRQ //irq stack
++ msr CPSR_c, r2
++ BigAdd sp, r0, SS_IRQ
++
++ sub r2, r2, #PSR_MODE_IRQ-PSR_MODE_FIQ //fiq stack
++ msr CPSR_c, r2
++ BigAdd sp, r0, SS_IRQ+SS_FIQ
++
++ add r2, r2, #PSR_MODE_SYSTEM-PSR_MODE_FIQ //system(user mode)
++ msr CPSR_c, r2
++ BigAdd sp, r0, SS_IRQ+SS_FIQ+SS_SYSTEM
++
++ sub r2, r2, #PSR_MODE_SYSTEM-PSR_MODE_UNDEF //undefined stack
++ msr CPSR_c, r2
++ BigAdd sp, r0, SS_IRQ+SS_FIQ+SS_SYSTEM+SS_UNDEFINED
++
++ sub r2, r2, #PSR_MODE_UNDEF-PSR_MODE_ABORT //Abort stack
++ msr CPSR_c, r2
++ BigAdd sp, r0, SS_IRQ+SS_FIQ+SS_SYSTEM+SS_UNDEFINED+SS_ABORT
++//
++ msr CPSR_c, r1
++ sub r2, r2, #PSR_MODE_ABORT-PSR_MODE_SVC //supervisor stack
++
++// ****************************
++ CP14_DCSR mrc,sp
++ tst sp,#1<<5 //test sticky abort bit
++ mov sp,r0
++ BigMovEq r0,DEBUG_BASE+DBG_MAGIC
++ BigAddNe r0,r3,(-0x1000+((DEBUG_BASE+DBG_MAGIC)&0xfff)) //don't use virtual address if memory isn't working right
++ sub r0,r0,#DBG_MAGIC
++
++ and r1,r1,#PSR_MODE_MASK
++ mov r3,#0
++ cmp r1,#PSR_MODE_DEBUG
++ BigMov lr,0xa0008000 //default start pc
++ beq SaveDebug //br if a debug exception in halt mode
++ mov r1,#SIG_RESET
++ b SaveR4andUp
++#else
++//#define GPBIT 2
++//#define GPL GPLR1
++#define GPBIT 9
++#define GPL GPLR0
++#define GPMASK (1<<GPBIT)
++GPTest:
++ BigMov rUart,UART_BASE
++ BigMov fp,GPIO_BASE
++ mov r6,#GPMASK
++ str r6,[fp,#GPSR0]
++
++2: bl TransmitCRLF
++ mov r3,#40
++20: mov r2,#0x300000
++
++1: ldr r0,[fp]
++ and r0,r1,#GPMASK
++ cmp r0,r6
++ subnes r2,r2,#1
++ bne 1b //wait for desired state
++
++ mov r1,#L1(0)
++ add r0,r1,r0,LSR #GPBIT
++ bl Transmit
++
++ mov r0,#GPMASK
++ eors r6,r6,#GPMASK //get new desired state
++ streq r0,[fp,#GPCR0]
++ strne r0,[fp,#GPSR0]
++ subs r3,r3,#1
++ bne 20b
++ b 2b
++#endif
++
++
++
++
++ .if 0 //macro tests
++ BigMov r0,-1
++ BigMov r0,-5
++ BigMov r0,0x0ffffff0
++ BigMov r0,1
++ BigMov r0,0xff
++ BigMov r0,0xf000000f
++ BigMov r0,0x80010003
++ .endif
++
++
++TransLineR3:
++ mov r4,#0
++TransLineR4:
++ mov r5,#0
++TransLineR5:
++ mov r6,#0
++TransLineR6:
++ mov r7,#0
++TransLineR7:
++ mov fp,lr
++ mov r0,r2
++ bl Transmit1
++
++ BigEor r0,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(SPACE,SPACE,MINUS,SPACE)
++ bl Transmit1
++
++ mov r0,r3
++ bl Transmit1
++ movs r0,r4
++ blne Transmit1
++ movs r0,r5
++ blne Transmit1
++ movs r0,r6
++ blne Transmit1
++ movs r0,r7
++ blne Transmit1
++ mov lr,fp
++ b TransmitCRLF
++
++Help_Cmd:
++ BigMov rSP,L2(SPACE,SPACE)
++ orr rSP,rSP,rSP,LSL #16
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(B,C,SPACE,SPACE) //BC -Breakpoint clear
++ BigEor r3,r2, L4(B,C,SPACE,SPACE)^L4(B,r,e,a)
++ BigMov r4, L4(k,p,o,i)
++ BigEor r5,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(n,t,SPACE,c)
++ BigMov r6, L4(l,e,a,r)
++ bl TransLineR6
++
++ BigEor2 r2,L4(B,C,SPACE,SPACE) ^L4(B,E,SPACE,SPACE) //BE -Breakpoint examine
++ BigEor2 r5,L4(n,t,SPACE,c) ^L4(n,t,SPACE,e)
++ BigMov r6, L4(x,a,m,i)
++ BigMov r7, L2(n,e)
++ bl TransLineR7
++
++ BigEor2 r2,L4(B,E,SPACE,SPACE) ^L4(B,S,SPACE,SPACE) //BS -Breakpoint set
++ BigEor2 r5,L4(n,t,SPACE,e) ^L4(n,t,SPACE,s)
++ BigMov r6, L2(e,t)
++ bl TransLineR6
++
++ BigEor2 r2,L4(B,S,SPACE,SPACE) ^L4(B,U,R,N) //BURN-Write to flash
++ BigMov r3, L4(W,r,i,t)
++ BigEor r4,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(e,SPACE,t,o)
++ BigMov r5, L4(SPACE,f,l,a)
++ BigMov r6, L2(s,h)
++ bl TransLineR6
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(E,SPACE,SPACE,SPACE) //E -Examine
++ BigEor r3,r2, L4(E,SPACE,SPACE,SPACE)^L4(E,x,a,m)
++ BigMov r4, L3(i,n,e)
++ bl TransLineR4
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(D,SPACE,SPACE,SPACE) //D -Deposit
++ BigEor r3,r2, L4(D,SPACE,SPACE,SPACE)^L4(D,e,p,o)
++ BigMov r4, L3(s,i,t)
++ bl TransLineR4
++
++ BigEor2 r2,L4(D,SPACE,SPACE,SPACE) ^L4(D,L,SPACE,SPACE) //DL -Download
++ BigEor2 r3,L4(D,e,p,o) ^L4(D,o,w,n)
++ BigMov r4, L4(l,o,a,d)
++ bl TransLineR4
++
++ BigEor2 r2,L4(D,L,SPACE,SPACE) ^L4(D,L,W,SPACE) //DLW -Download wireless
++ BigEor r5,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(SPACE,w,i,r)
++ BigMov r6, L4(e,l,e,s)
++ BigMov r7, L1(s)
++ bl TransLineR7
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(G,SPACE,SPACE,SPACE) //G -Go
++ BigMov r3, L2(G,o)
++ bl TransLineR3
++
++ BigEor2 r2,L4(G,SPACE,SPACE,SPACE) ^L4(G,L,SPACE,SPACE) //GL -Go Linux
++ BigEor2 r3,L2(G,o) ^L4(G,o,SPACE,L)
++ BigMov r4, L4(i,n,u,x)
++ bl TransLineR4
++
++ BigEor2 r2,L4(G,L,SPACE,SPACE) ^L4(G,G,SPACE,SPACE) //GG -Go no cache clear
++ BigEor2 r3,L4(G,o,SPACE,L) ^L4(G,o,SPACE,n)
++ BigEor r4,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(o,SPACE,c,a)
++ BigEor r5,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(c,h,e,SPACE)
++ BigMov r6, L4(c,l,e,a)
++ BigMov r7, L1(r)
++ bl TransLineR7
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(R,SPACE,SPACE,SPACE) //R -Registers
++ BigEor r3,r2, L4(R,SPACE,SPACE,SPACE)^L4(R,e,g,i)
++ BigMov r4, L4(s,t,e,r)
++ BigMov r5, L1(s)
++ bl TransLineR5
++
++ BigMov r2, L4(S,S,I,D) //SSID- Set SSID string
++ BigEor r3,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(S,e,t,SPACE)
++ mov r4,r2
++ BigMov r5, L4(SPACE,s,t,r)
++ BigMov r6, L3(i,n,g)
++ bl TransLineR6
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(T,SPACE,SPACE,SPACE) //T -Trace
++ BigEor r3,r2, L4(T,SPACE,SPACE,SPACE)^L4(T,r,a,c)
++ BigMov r4,L1(e)
++ bl TransLineR4
++
++ BigEor2 r2,L4(T,SPACE,SPACE,SPACE) ^L4(T,T,SPACE,SPACE) //TT -Trace
++ BigEor2 r4,L1(e) ^L4(e,SPACE,n,o)
++ BigEor r5,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(SPACE,c,a,c)
++ BigEor r6,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(h,e,SPACE,c)
++ BigMov r7, L4(l,e,a,r)
++ bl TransLineR7
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(V,SPACE,SPACE,SPACE) //V -Verify
++ BigEor r3,r2, L4(V,SPACE,SPACE,SPACE)^L4(V,e,r,i)
++ BigMov r4, L2(f,y)
++ bl TransLineR4
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(W,C,SPACE,SPACE) //WC -Watch clear
++ BigEor r3,r2, L4(W,C,SPACE,SPACE)^L4(W,a,t,c)
++ BigEor r4,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(h,SPACE,c,l)
++ BigMov r5, L3(e,a,r)
++ bl TransLineR5
++
++ BigEor2 r2,L4(W,C,SPACE,SPACE) ^L4(W,R,SPACE,SPACE) //WR -Watch read
++ BigEor2 r4,L4(h,SPACE,c,l) ^L4(h,SPACE,r,e)
++ BigMov r5, L2(a,d)
++ bl TransLineR5
++
++ BigEor2 r2,L4(W,R,SPACE,SPACE) ^L4(W,R,W,SPACE) //WRW -Watch read/write
++ BigEor2 r5,L2(a,d) ^L4(a,d,FSLASH,w)
++ BigMov r6, L4(r,i,t,e)
++ bl TransLineR6
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(W,W,SPACE,SPACE) //WW -Watch write
++ BigEor2 r4,L4(h,SPACE,r,e) ^L4(h,SPACE,w,r)
++ BigMov r5, L3(i,t,e)
++ bl TransLineR5
++
++ BigEor r2,rSP,L4(SPACE,SPACE,SPACE,SPACE)^L4(QUESTION_MARK,SPACE,SPACE,SPACE) //? -Help
++ BigMov r3, L4(H,e,l,p)
++ bl TransLineR3
++
++ b Prompt
++
++//.global CalcMemEnd
++CalcMemEnd:
++ CalcMemSize r1,r0,MEMORY_CONTROL_BASE //out: r0 - mem size
++ BigAdd2 r0,MEM_START //32 meg
++ mov pc,lr
++
++
++//rRamSector - start (rNum1)
++//rRamEnd - end (rNum2)
++Verify_Cmd:
++ mov r5,#CMD_VERIFY
++ b Burn1
++Verify2_Cmd:
++ mov r5,#CMD_VERIFY
++ b Burn2
++BurnAll_Cmd:
++ mov r5,#CMD_BURNALL
++ b Burn1
++Burn2_Cmd:
++ mov r5,#CMD_BURN
++Burn2:
++ BigMov r4,FLASH_BASE_ADDRESS+(16<<20)
++ b BurnContinue
++Burn_Cmd:
++ mov r5,#CMD_BURN
++Burn1:
++ BigMov r4,FLASH_BASE_ADDRESS
++BurnContinue:
++ tst rValidCnt,#F_NUM1_MASK
++ tstne rValidCnt,#F_NUM2_MASK
++ beq Invalid
++ tst rRamSector,#3
++ bne Invalid
++ tst rRamEnd,#3
++ bne Invalid
++ cmp rRamSector,rRamEnd
++ bhs Invalid
++ cmp rRamSector,#MEM_START
++ blo Invalid //br if rRamSector is below ram start,
++ bl CalcMemEnd
++ mov r1,r4
++ cmp rRamEnd,r0
++ bhi Invalid //br if rRamEnd is above ram end,
++ sub lr,rRamEnd,rRamSector
++ cmp lr,#f128j3a_SIZE
++ bhi Invalid
++
++ mvn r2,#0
++ tst rRamEnd,#1
++ strneb r2,[rRamEnd],#1
++ tst rRamEnd,#2
++ strneh r2,[rRamEnd],#2
++
++//1st verify that flash needs burned
++ mov lr,rRamSector
++1: ldr r2,[lr],#4
++ ldr r3,[r1],#4
++ cmp r2,r3
++ bne 2f
++ cmp lr,rRamEnd
++ blo 1b
++
++ cmp r5,#CMD_BURNALL
++ beq 3f
++ BigMov r0,L4(V,e,r,i)
++ bl Transmit1
++ BigMov r0,L4(f,i,e,d)
++ bl Transmit1
++ b Prompt
++2:
++ sub r1,r1,#4
++ cmp r5,#CMD_VERIFY
++ bne 3f
++ sub r0,lr,#4
++20:
++ bl Burn_error
++ b Prompt
++3:
++ mov rFlashSector,r1,LSR #18
++ mov rFlashSector,rFlashSector,LSL #18 //round to 256k boundary
++ add rRamSector,rRamSector,rFlashSector
++ sub rRamSector,rRamSector,r4
++ BigMov r3,MEMORY_CONTROL_BASE
++ tst rFlashSector,#1<<26
++ ldr r1,[r3,#MSC0]
++ movne r1,r1,LSR #16 //nCS1 being used for flash
++ tst r1,#1<<3 //bit 3 - 1 means 16 bit mode
++ adr r4,Burn_Rtn32
++ ldr r3,[r4]
++ BigMov r2,0xe58d5054 //NOTE: when 1st instruction of Burn_Rtn32 changes (or DBG_TEMP value), this must change as well
++ adrne r4,Burn_Rtn16
++
++ cmp r4,#MEM_START
++ bhs 10f
++//I must move the burn code, unless I'm only running from cache
++ cmp r2,r3
++ bne 10f
++ tst r1,#1<<3 //bit 3 - 1 means 16 bit mode
++ BigAdd r1,r0,(-0x1000+((DEBUG_BASE+DBG_START)&0xfe0)-32)
++ moveq r3,#((Burn_Rtn_End-Burn_Rtn32)+0x1f)&(~0x1f) //round to 32 byte (cache line)boundary
++ movne r3,#((Burn_Rtn_End-Burn_Rtn16)+0x1f)&(~0x1f) //round to 32 byte (cache line)boundary
++ add r2,r4,r3
++ sub r1,r1,r3
++ mov r0,r1
++4: ldr r3,[r4],#4
++ str r3,[r1],#4
++ cmp r4,r2
++ blo 4b
++
++ mov r4,r0
++5:
++ CP15_CF_INVAL_ILINE mcr,r4
++ add r4,r4,#32
++ cmp r4,r1
++ blo 5b
++
++ CP15_CF_INVAL_BTB mcr,r4
++
++ CP15_CF_DRAIN mcr,r4 //data cache is disabled, but it should still drain first
++ CPWAIT r1
++
++ BigMov rFlashBase,FLASH_BASE_ADDRESS
++ mov rRet,#0
++ blx r0
++ b 20b //unknow Man/dev Id if it returns from here
++
++10:
++//I'm running from ram, or from cache only
++ BigMov rFlashBase,FLASH_BASE_ADDRESS
++ adr rRet,11f
++ blx r4
++ b 20b //unknow Man/dev Id if it returns from here
++11: b Prompt
++
++
++
++
++//BurnRtn istr,ildr,mask,shift,inc,plait
++Burn_Rtn32:
++ BurnRtn str,ldr,0xffffffff,0,0,4,0
++Burn_Rtn16:
++#if 1
++ BigMov r0,FLASH_STATUS_CLEAR_CMD&0xffff
++ strh r0,[rFlashBase,#0]
++ delay
++ BigMov r0,FLASH_ID_CMD&0xffff
++ strh r0,[rFlashBase,#0]
++ delay
++ ldrh r2,[rFlashBase,#2]
++
++ BigMov r0,FLASH_READ_CMD&0xffff
++ strh r0,[rFlashBase,#0]
++ delayCnt r0,((40/10)*COUNT_MULT)
++ cmp r2,#0x16
++ cmpne r2,#0x17
++ cmpne r2,#0x18
++ beq 99f
++//(PLATFORM_TYPE==GAME_CONTROLLER_PLAITED_A1)
++ BurnRtn strh,ldrh, 0xffff,0,1,4,1 //the plait version (a1 jumpered to a high address line)
++99:
++ BurnRtn strh,ldrh, 0xffff,1,1,2,0 //the non-plait version (a1 correct)
++#else
++
++#if (PLATFORM_TYPE==GAME_CONTROLLER_PLAITED_A1)
++ BurnRtn strh,ldrh, 0xffff,0,1,4,1 //the plait version (a1 jumpered to a high address line)
++#else
++99:
++ BurnRtn strh,ldrh, 0xffff,1,1,2,0 //the non-plait version (a1 correct)
++#endif
++
++#endif
++
++Timeout:
++ BigMov r0,L4(T,i,m,e)
++ bl TransmitR
++ BigMov r0,L4(d,SPACE,o,u)
++ bl TransmitR
++ BigMov r0,L2(t,SPACE)
++ bl TransmitR
++
++ mov r0,rRamSector
++ mov r1,rFlashSector
++ ldr r2,[r0]
++ ldr r3,[r1]
++ bl Burn_error
++ b Burn_return
++
++ReturnError:
++ sub r0,r0,#4
++ sub r1,r1,#4
++ bl Burn_error
++ b Burn_return
++
++PrintSector:
++ mov r5,lr
++ bl TransmitR_CRLF
++ BigMov r0,L4(S,e,c,t)
++ bl TransmitR
++ BigMov r0,L3(o,r,SPACE)
++ bl TransmitR
++ mov r0,rFlashSector
++ bl PrintHexR
++ mov r0,#L1(SPACE)
++ bl TransmitR
++ mov r0,rRamSector
++ mov r1,rFlashSector
++ mov pc,r5
++
++PrintErasing:
++ mov r5,lr
++ BigMov r0,L4(E,r,a,s)
++ bl TransmitR
++ BigMov r0,L4(i,n,g,SPACE)
++ mov lr,r5
++ b TransmitR
++
++PrintProgramming:
++ mov r5,lr
++ BigMov r0,L4(P,r,o,g)
++ bl TransmitR
++ BigMov r0,L4(r,a,m,m)
++ bl TransmitR
++ BigMov r0,L4(i,n,g,SPACE)
++ bl TransmitR
++ mov r0,rRamSector
++ mov r1,rFlashSector
++ mov pc,r5
++
++PrintVerifying:
++ mov r5,lr
++ BigMov r0,L4(V,e,r,i)
++ bl TransmitR
++ BigMov r0,L4(f,y,i,n)
++ bl TransmitR
++ BigMov r0,L4(g,PERIOD,PERIOD,PERIOD)
++ bl TransmitR
++ mov r0,rRamSector
++ mov r1,rFlashSector
++ mov pc,r5
++
++PrintSuccess:
++ bl TransmitR_CRLF
++ BigMov r0,L4(S,u,c,c)
++ bl TransmitR
++ BigMov r0,L3(e,s,s)
++ bl TransmitR
++// b Burn_return
++
++Burn_return:
++ bl TransmitR_CRLF
++ bl WaitTxEmpty
++ movs rRet,rRet
++ CP15_CF_INVAL_BOTH mcreq,r1 //invalidate if return is reset vector
++ CPWAIT r1
++ mov pc,rRet
++
++Burn_error:
++ mov r8,lr
++ mov r5,r1
++ mov sl,r2
++ mov r7,r3
++ bl PrintHexR
++ mov r0,#L1(COLON)
++ bl TransmitR
++ mov r0,sl
++ bl PrintHexR
++ bl TransmitSPACER
++
++ mov r0,r5
++ bl PrintHexR
++ mov r0,#L1(COLON)
++ bl TransmitR
++ mov r0,r7
++ mov lr,r8
++ b PrintHexR
++
++ DEFINE_FLASH_GPIO_WAIT_FOR_IDLE
++
++
++WaitTxEmpty:
++1: ldr r1,[rUart,#UART_LSR]
++ ands r1,r1,#0x40
++ beq 1b
++ mov pc,lr //return
++
++TransmitSPACER:
++ mov r0,#L1(SPACE)
++ b TransmitR
++TransmitR_CRLF:
++ BigMov r1,L2(CR,LF)
++trR:
++ mov r0,r1
++//IN: r0 - character to transmit
++//OUT: r0 - last character transmitted, r1 - trashed
++TransmitR:
++1: ldr r1,[rUart,#UART_LSR]
++ ands r1,r1,#0x20
++ beq 1b
++ mov r1,r0
++ and r1,r1,#0xff
++ str r1,[rUart,#UART_THR]
++ movs r1,r0,LSR #8
++ bne trR
++ mov pc,lr //return
++//IN: r0 - value to print
++//OUT: r0-r4 trashed
++PrintHexR:
++ mov r2,#8
++ mov r4,r0
++ mov r3,lr
++1: mov r4,r4,ROR #28
++ and r0,r4,#0xf
++ cmp r0,#0xA
++ addcs r0,r0,#L1(A)-0x0a
++ addcc r0,r0,#L1(0)
++ bl TransmitR
++ subs r2,r2,#1
++ bne 1b
++ mov pc,r3
++
++Burn_Rtn_End:
++
++
++SSID_Cmd:
++ BigMov r0,L4(I,d,COLON,SPACE)
++ bl Transmit1
++ bl CalcMemEnd
++ BigAdd r5,r0,(-0x1000+((DEBUG_BASE+DBG_START)&0xfff)-32)
++ mov r6,#31
++1: bl Receive
++ beq 1b //br on timeout
++ cmp r0,#CR
++ beq 2f
++ strb r0,[r5],#1
++ bl Transmit1
++ subs r6,r6,#1
++ bne 1b
++2: mov r0,#0
++ strb r0,[r5],#1
++ b Prompt
++
++MAC_Cmd:
++ mov r2,#FUNC_REQ_MAC
++ b join_cmd
++Download_Wireless_Cmd:
++ tst rValidCnt,#F_NUM1_MASK
++ beq Invalid
++ tst rNum1,#3
++ bne Invalid
++ cmp rNum1,#MEM_START
++ bcc Invalid //br if rNum1 is below ram start,
++ //NOTE: arm sets the carry to the opposite of most processors on subtract, compare
++ mov r2,#FUNC_REQ_DLW
++join_cmd:
++ bl TryRoutine
++ ldmia sp,{rPrevNum1,rUart,rDBG}
++ bl SetupATAG //dlw is now overwriting ATAG space, so set it again
++ b Prompt
++
++//struct tag_mem32 {
++// u32 size;
++// u32 start; /* physical start address */
++//};
++
++//out: r2,r7 - saved, r0 - CalcMemEnd return value
++SetupATAG:
++ mov r3,lr
++ bl CalcMemEnd
++ mov lr,r3
++ BigMov r1,TAGGED_LIST
++ BigMov r3,2
++ BigMov r4,ATAG_CORE
++ BigMov r5,4
++ BigEor r6,r4,(ATAG_MEM^ATAG_CORE)
++ stmia r1!,{r3,r4,r5,r6}
++ BigMov r4,MEM_START
++ BigMov r5,0
++ sub r3,r0,r4
++ stmia r1,{r3,r4,r5}
++ mov pc,lr
++
++
++Gl_Cmd:
++ mov r2,#FUNC_REQ_PIC
++ bl TryRoutine
++ ldmia sp,{rPrevNum1,rUart,rDBG}
++
++ BigMov r1,MACH_TYPE_SCANPASS
++ str r1,[rDBG,#DBG_R1]
++ mov r2,#FUNC_REQ_GL
++ bl TryRoutine
++ ldmia sp,{rPrevNum1,rUart,rDBG}
++ movs rNum1,r4
++ bne Go_Cmd
++ b Prompt
++
++//r2- function select
++TryRoutine:
++ mov r10,#0
++ mov r7,lr
++ bl TryRoutine1
++ b Invalid
++//r10- RCSR
++//r2- function select
++//r7- main return
++//lr- error return
++TryRoutine1:
++ adr r0,MiniDebugEnd
++ ldr r1,[r0]
++ BigMov r3,0xe1a08000
++ cmp r1,r3
++ movne pc,lr //failure return
++ bl SetupATAG //out: r0 - calcMemEnd return value
++ mov lr,r7
++
++ BigAdd r1,r0,(-0x1000+((DEBUG_BASE+DBG_START)&0xfff)-32) //@ssid
++ mov r0,r1
++ stmdb r0!,{rPrevNum1,rUart,rDBG}
++ mov sp,r0
++ mov fp,r0
++ mov r0,rNum1
++ adr r4,MiniDebugEnd
++ mov r3,#DEF_DISPLAY_INDEX
++ b HeadStart
++
++ .ifdef __ARMASM
++ DUP 6,0xffffffff
++ align 256
++ .else
++ .balignl 256,0xffffffff
++ .endif
++
++MiniDebugEnd:
++//This is defined in head.S or minidebug.lds
++//HeadStart:
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/ministart.S u-boot-1.1.2-neon/cpu/pxa/ministart.S
+--- u-boot-1.1.2/cpu/pxa/ministart.S 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/ministart.S 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,270 @@
++/*
++ * armboot - Startup Code for XScale
++ *
++ * Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
++ * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
++ * Copyright (C) 2000 Wolfgang Denk <wd@denx.de>
++ * Copyright (C) 2001 Alex Zuepke <azu@sysgo.de>
++ * Copyright (C) 2002 Kyle Harris <kharris@nexus-tech.net>
++ * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
++ * Copyright (C) 2003 Kai-Uwe Bloem <kai-uwe.bloem@auerswald.de>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ */
++
++#include <config.h>
++#include <version.h>
++#include <asm/arch/pxaMacro.h>
++
++#define Mode_SVC 0x13
++#define NoIntsMask 0xc0
++.globl _bss_start
++.globl _bss_end
++
++//defined globals
++.globl HeadStart
++.globl _armboot_start
++
++//r3 - display type
++HeadStart:
++ mov r8,r0 //there is a check for this instruction before jumping here
++
++// ********************************************************************
++// Set processor into Supervisior mode (SVC) and disable IRQ & FIQ
++//
++ mrs r0, CPSR
++ bic r0, r0,#0x1f
++ orr r0, r0,#(Mode_SVC | NoIntsMask)
++ msr cpsr_c, r0
++//exit SDS, if currently active
++ msr SPSR, r0
++ adr lr,1f
++ movs pc,lr
++1:
++ b relocate
++// ********************************************************************
++_armboot_start:
++_TEXT_BASE: .word TEXT_BASE
++
++_start_armboot: .word start_armboot
++/*
++ * These are defined in the board-specific linker script.
++ */
++_bss_start: .word __bss_start
++_bss_end: .word _end
++
++#ifdef CONFIG_USE_IRQ
++/* IRQ stack memory (calculated at run-time) */
++.globl IRQ_STACK_START
++IRQ_STACK_START:
++ .word 0x0badc0de
++
++/* IRQ stack memory (calculated at run-time) */
++.globl FIQ_STACK_START
++FIQ_STACK_START:
++ .word 0x0badc0de
++#endif
++
++relocate: /* relocate U-Boot to RAM */
++ adr r0, HeadStart /* r0 <- current position of code */
++ bic r0,r0,#0xff
++ bic r0,r0,#0xff00 //64k aligned
++ ldr r1, _TEXT_BASE
++ cmp r0, r1 /* don't reloc during debug */
++ beq stack_setup
++
++ ldr r2, _bss_start
++
++copy_loop:
++ ldmia r0!, {r3-r10} /* copy from source address [r0] */
++ stmia r1!, {r3-r10} /* copy to target address [r1] */
++ cmp r1, r2 /* until dest end addreee [r2] */
++ ble copy_loop
++
++ /* Set up the stack */
++stack_setup:
++ ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
++ BigSub2 r0,(CFG_MALLOC_LEN+CFG_GBL_DATA_SIZE+CFG_MMU_SPACE_RESERVED) //malloc area,bdinfo
++#ifdef CONFIG_USE_IRQ
++ sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
++#endif
++ sub sp, r0, #12 /* leave 3 words for abort-stack */
++
++clear_bss:
++ ldr r0, _bss_start /* find start of bss segment */
++ ldr r1, _bss_end /* stop here */
++ mov r2, #0x00000000 /* clear */
++
++clbss_l:str r2, [r0] /* clear loop... */
++ add r0, r0, #4
++ cmp r0, r1
++ bne clbss_l
++ bl dcache_enable
++
++ ldr pc, _start_armboot
++
++
++FlushCache:
++ CP15_CONTROL mrc,r0
++ tst r0, #4 //is data cache enabled
++ beq 2f
++// b 2f
++ mov r1, #2048
++ add r0,pc,#0x20000 //make sure I don't alloc a line in this subroutine
++ BigBic2 r0, 0xffff
++1: CP15_CF_ALLOC_LINE mcr,r0
++ add r0, r0, #0x20
++ subs r1, r1, #1
++ bne 1b
++
++ CP15_CF_DRAIN mcr,r0
++ CPWAIT r0
++2: CP15_CF_INVAL_BOTH mcr,r0
++ CPWAIT r0
++ mov pc, lr
++
++
++
++//void dcache_disable (void)
++.globl dcache_disable
++dcache_disable:
++ mov r3,lr
++ bl FlushCache
++ CP15_CONTROL mrc,r1
++
++ BigBic2 r1, 0x2805 //disable high vector, branch target buffer, disable data cache, MMU
++ .balignl 32,0xe1a00000 //cacheline boundary (32 bytes)
++ //Needed so that if new flash is burnt
++ //and flash != ram copy,
++ //mov pc, r3 will be in cache and execute correctly
++ //(r3 is 0) return to the reset vector
++ CP15_CONTROL mcr,r1
++ CPWAIT r0
++ mov pc, r3
++
++
++//int dcache_status (void)
++.globl dcache_status
++dcache_status:
++ CP15_CONTROL mrc,r0 //get the control register
++ and r0,r0,#1
++ mov pc,lr
++
++#define MEM_START1 0xa0000000
++#define MEM_END1 0xa4000000
++//void dcache_enable (void)
++.globl dcache_enable
++dcache_enable:
++ stmdb sp!,{r5,r6,lr}
++ bl FlushCache
++#if !defined(CFG_MMU_SPACE_RESERVED) || (CFG_MMU_SPACE_RESERVED<(1<<14))
++ mov r0,#1<<15 //16k plus alignment of 16k
++ bl malloc
++ add r6,r0,#(1<<14) //16k alignment
++ BigBic2 r6,(1<<14)-1
++#else
++ ldr r6, _TEXT_BASE /* upper 128 KiB: relocated uboot */
++ BigSub2 r6,(CFG_MMU_SPACE_RESERVED) //malloc area,bdinfo
++#endif
++ mov r2,r6
++ add r5,r6,#(1<<14) //16k 1st level page table
++ BigMov r0,0x0402 //section descriptor, ap-01, privileged r/w
++ //map virt to phys 1-to-1, non-cache, non-bufferable
++1: str r0,[r2],#4
++ add r0,r0,#1<<20
++ cmp r2,r5
++ bne 1b
++
++
++ mov r3,#MEM_END1
++ add r5,r6,r3,LSR #(20-2)
++ add r1,r6,#(MEM_START1>>20)<<2
++ BigMov r0,(MEM_START1&0xfff00000)+0x040A //cacheable (write through)
++2: str r0,[r1],#4
++ cmp r1,r5
++ addne r0,r0,#1<<20
++ bne 2b
++
++ BigMov r0,0xffffffff
++ CP15_DACR mcr,r0
++
++ CP15_TTBR mcr,r6
++//enable MMU
++ CP15_TLB_UNLOCK_I mcr,r0
++ CP15_TLB_UNLOCK_D mcr,r0
++ CP15_TLB_INVAL_BOTH mcr,r0
++
++ CP15_CONTROL mrc,r1 //get the control register
++ BigOrr2 r1,0x201 // enable MMU, r bit
++ BigBic2 r1,0x100 // disable S bit, ap -0 means read only by all
++ CPWAIT r0
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++//enable the instruction cache
++ CP15_CF_UNLOCK_I mcr,r0
++// CP15_CF_INVAL_I mcr,r0 //I might be running from cache only, don't invalidate
++
++ orr r1,r1,#0x1000 //set bit 12 -- the I bit
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++//enable the data cache
++// CP15_CF_UNLOCK_D mcr,r0
++ CP15_CF_INVAL_D mcr,r0 //this will also drain write buffer
++ CP15_CF_DRAIN mcr,r0 //make sure it is drained just to be very safe
++
++ orr r1,r1,#0x4 //set bit 4 -- the D bit
++ CP15_CONTROL mcr,r1 //set the control register
++ CPWAIT r0
++
++ BigMov r0,0x3fff
++ CP15_CP_ACCESS mcr,r0 //enable access to all coprocessors
++ ldmia sp!,{r5,r6,pc}
++
++
++
++/****************************************************************************/
++/* */
++/* Reset function: the PXA250 doesn't have a reset function, so we have to */
++/* perform a watchdog timeout for a soft reset. */
++/* */
++/****************************************************************************/
++.globl reset_cpu
++ /* FIXME: this code is PXA250 specific. How is this handled on */
++ /* other XScale processors? */
++
++reset_cpu:
++ BigMov r0,0x40a00000 //OSTIMER_BASE
++ /* We set OWE:WME (watchdog enable) and wait until timeout happens */
++
++ ldr r1, [r0, #OWER]
++ orr r1, r1, #0x0001 /* bit0: WME */
++ str r1, [r0, #OWER]
++
++ /* OS timer does only wrap every 1165 seconds, so we have to set */
++ /* the match register as well. */
++
++ ldr r1, [r0, #OSCR] /* read OS timer */
++ add r1, r1, #0x800 /* let OSMR3 match after */
++ add r1, r1, #0x800 /* 4096*(1/3.6864MHz)=1ms */
++ str r1, [r0, #OSMR3]
++
++reset_endless:
++ b reset_endless
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/mmc.c u-boot-1.1.2-neon/cpu/pxa/mmc.c
+--- u-boot-1.1.2/cpu/pxa/mmc.c 2003-10-16 01:53:52.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/pxa/mmc.c 2007-08-11 21:07:20.000000000 +0200
+@@ -27,6 +27,7 @@
+ #include <asm/errno.h>
+ #include <asm/arch/hardware.h>
+ #include <part.h>
++#include <command.h>
+
+ #ifdef CONFIG_MMC
+
+@@ -47,9 +48,19 @@
+ static uchar mmc_buf[MMC_BLOCK_SIZE];
+ static mmc_csd_t mmc_csd;
+ static int mmc_ready = 0;
++static int isSD = 0 ;
++static int startBlock = 0 ;
++static ushort RCA = MMC_DEFAULT_RCA ;
++static struct partition part ;
+
++static void stop_clock( void )
++{
++ MMC_STRPCL = MMC_STRPCL_STOP_CLK;
++ MMC_I_MASK = ~MMC_I_MASK_CLK_IS_OFF;
++ while (!(MMC_I_REG & MMC_I_REG_CLK_IS_OFF));
++}
+
+-static uchar *
++uchar *
+ /****************************************************/
+ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat)
+ /****************************************************/
+@@ -59,9 +70,8 @@
+ int words, i;
+
+ debug("mmc_cmd %x %x %x %x\n", cmd, argh, argl, cmdat);
+- MMC_STRPCL = MMC_STRPCL_STOP_CLK;
+- MMC_I_MASK = ~MMC_I_MASK_CLK_IS_OFF;
+- while (!(MMC_I_REG & MMC_I_REG_CLK_IS_OFF));
++ stop_clock();
++
+ MMC_CMD = cmd;
+ MMC_ARGH = argh;
+ MMC_ARGL = argl;
+@@ -71,9 +81,10 @@
+ while (!(MMC_I_REG & MMC_I_REG_END_CMD_RES));
+
+ status = MMC_STAT;
+- debug("MMC status %x\n", status);
++ debug("MMC status %lx\n", status);
+ if (status & MMC_STAT_TIME_OUT_RESPONSE)
+ {
++ printf( "mmc_cmd timeout: cmd: 0x%x, args: 0x%04x%04x, status 0x%lx\n", cmd, argh, argl, status );
+ return 0;
+ }
+
+@@ -85,7 +96,7 @@
+ break;
+
+ case MMC_CMDAT_R2:
+- words = 8;
++ words = 9;
+ break;
+
+ default:
+@@ -109,6 +120,22 @@
+ return resp;
+ }
+
++static void mmc_setblklen( ulong blklen )
++{
++ static ulong prevLen = -1UL ;
++ if( blklen != prevLen )
++ {
++ ushort argh, argl ;
++
++ argh = blklen >> 16;
++ argl = blklen & 0xffff;
++
++ /* set block len */
++ mmc_cmd( MMC_CMD_SET_BLOCKLEN, argh, argl, MMC_CMDAT_R1);
++ prevLen = blklen ;
++ }
++}
++
+ int
+ /****************************************************/
+ mmc_block_read(uchar *dst, ulong src, ulong len)
+@@ -117,20 +144,18 @@
+ uchar *resp;
+ ushort argh, argl;
+ ulong status;
++ unsigned char volatile *rxFIFO = (unsigned char *)&(MMC_RXFIFO);
+
+ if (len == 0)
+ {
+ return 0;
+ }
+
+- debug("mmc_block_rd dst %lx src %lx len %d\n", (ulong)dst, src, len);
++ debug("mmc_block_rd dst %lx src %lx len %ld\n", (ulong)dst, src, len);
+
+- argh = len >> 16;
+- argl = len & 0xffff;
+-
+- /* set block len */
+- resp = mmc_cmd(MMC_CMD_SET_BLOCKLEN, argh, argl, MMC_CMDAT_R1);
++ mmc_setblklen( len );
+
++ src += (startBlock*MMC_BLOCK_SIZE);
+ /* send read command */
+ argh = src >> 16;
+ argl = src & 0xffff;
+@@ -147,15 +172,14 @@
+ {
+ if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ)
+ {
+- *dst++ = MMC_RXFIFO;
+- len--;
+- }
+- status = MMC_STAT;
+- if (status & MMC_STAT_ERRORS)
+- {
+- printf("MMC_STAT error %lx\n", status);
+- return -1;
++ int i, bytes = min(32,len);
++ len -= bytes;
++
++ for (i=0; i<bytes; i++)
++ *dst++ = *rxFIFO ;
+ }
++ else if (MMC_STAT & MMC_STAT_ERRORS)
++ break;
+ }
+ MMC_I_MASK = ~MMC_I_MASK_DATA_TRAN_DONE;
+ while (!(MMC_I_REG & MMC_I_REG_DATA_TRAN_DONE));
+@@ -338,7 +362,7 @@
+ aligned_end = mmc_block_address & end;
+
+ /* all block aligned accesses */
+- debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++ debug("src %p dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+ src, (ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
+ if (part_start)
+ {
+@@ -357,22 +381,22 @@
+ dst += part_len;
+ src += part_len;
+ }
+- debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++ debug("src %p dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+ src, (ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
+ for (; dst < aligned_end; src += mmc_block_size, dst += mmc_block_size)
+ {
+- debug("al src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++ debug("al src %p dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+ src, (ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
+ if ((mmc_block_write(dst, (uchar *)src, mmc_block_size)) < 0)
+ {
+ return -1;
+ }
+ }
+- debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++ debug("src %p dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+ src, (ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
+ if (part_end && dst < end)
+ {
+- debug("pe src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++ debug("pe src %p dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+ src, (ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
+ if ((mmc_block_read(mmc_buf, aligned_end, mmc_block_size)) < 0)
+ {
+@@ -392,13 +416,324 @@
+ mmc_bread(int dev_num, ulong blknr, ulong blkcnt, ulong *dst)
+ /****************************************************/
+ {
++ debug( "read %lu blocks at block #%lu\n", blkcnt, blknr );
++
++ if( 0 < blkcnt )
++ {
++ if( 0 != getenv( "mblock" ) )
++ {
+ int mmc_block_size = MMC_BLOCK_SIZE;
+ ulong src = blknr * mmc_block_size + CFG_MMC_BASE;
+
+ mmc_read(src, (uchar *)dst, blkcnt*mmc_block_size);
++ }
++ else
++ {
++ ulong src = (blknr+startBlock) * MMC_BLOCK_SIZE ;
++ ulong status ;
++ uchar *dstb = (uchar *)dst ;
++ unsigned char volatile *rxFIFO = (unsigned char *)&(MMC_RXFIFO);
++
++ MMC_RDTO = 0xffff;
++ MMC_BLKLEN = MMC_BLOCK_SIZE ;
++ MMC_NOB = blkcnt ;
++
++ mmc_setblklen( MMC_BLOCK_SIZE );
++ mmc_cmd( MMC_CMD_RD_BLK_MULTI,
++ src >> 16,
++ src & 0xFFFF,
++ MMC_CMDAT_R1|MMC_CMDAT_READ|MMC_CMDAT_BLOCK|MMC_CMDAT_DATA_EN );
++
++ // read the data
++ for( blknr = 0 ; blknr < blkcnt ; blknr++ )
++ {
++ unsigned len = MMC_BLOCK_SIZE ;
++
++ while (len)
++ {
++ int i ;
++ MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ;
++ while( (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) == 0 )
++ {
++ }
++
++ for (i = 0; i < 32 ; i++ )
++ {
++ *dstb++ = *rxFIFO ;
++ }
++ len -= 32 ;
++ }
++ } // for each block
++
++ MMC_I_MASK = ~MMC_I_MASK_DATA_TRAN_DONE;
++ while (!(MMC_I_REG & MMC_I_REG_DATA_TRAN_DONE));
++ status = MMC_STAT;
++ if (status & MMC_STAT_ERRORS)
++ {
++ printf("MMC_STAT error %lx\n", status);
++ return -1;
++ }
++// printf( "completed mread... now stop\n" );
++
++ mmc_cmd( MMC_CMD_STOP, 0, 0, MMC_CMDAT_R1);
++
++ } // multi-block read
++ } // or why bother?
+ return blkcnt;
+ }
+
++static void dumpResponse( uchar *resp, unsigned bytes )
++{
++ debug( "rsp: " );
++ if( resp )
++ {
++ while( bytes-- )
++ debug( "%02X ", *resp++ );
++ debug( "\n" );
++ }
++ else
++ debug( "NULL\n" );
++}
++
++int SDCard_test( void )
++{
++ unsigned short response ;
++ unsigned long ignore ;
++ unsigned char *resp ;
++
++ mmc_cmd(0, 0, 0, 0);
++
++ resp = mmc_cmd(SD_APP_CMD55, 0, 0, MMC_CMDAT_R1);
++ if( !resp )
++ {
++ printf( "SDInitErr1\n" );
++ return -ENODEV ;
++ }
++
++ resp = mmc_cmd(SD_APP_CMD41, 0x0020, 0, MMC_CMDAT_INIT|MMC_CMDAT_R1);
++ if( !resp )
++ {
++ printf( "SDInitErr2\n" );
++ return -ENODEV ;
++ }
++
++ memcpy( &response, resp, sizeof( response ) );
++
++ while (response != 0x3f80)//continue doing ACMD1 until busy bit in response is set
++ {
++ //CMD55 APP_CMD
++ MMC_STRPCL = 0x00000001;//stop clock
++ while ((MMC_STAT & 0x00000100) == 0x00000100); //wait for clock to stop
++ MMC_CMD = 0x00000037;//CMD55 index APP_CMD
++ MMC_ARGH = 0x00000000;//relative card address 0x0
++ MMC_ARGL = 0x00000000;//stuff bits
++ MMC_CMDAT = 0x00000001;//expect response 1
++ MMC_STRPCL = 0x00000002;//start clock
++ while ((MMC_STAT & 0x00002000) == 0x00000000);//wait for end_cmd_res
++ //read response FIFO
++ response = MMC_RES & 0x0000ffff ;
++ ignore = MMC_RES ;
++ ignore = MMC_RES ;
++
++ //ACMD41
++ MMC_STRPCL = 0x00000001;//stop clock
++ while ((MMC_STAT & 0x00000100) == 0x00000100); //wait for clock to stop
++ MMC_CMD = 0x00000029;//ACMD41 index SD_APP_SEND_OP_COND
++ MMC_ARGH = 0x00000020;//set voltage limit of system in command argument
++ MMC_ARGL = 0x00000000;
++ MMC_CMDAT = 0x00000003;//expect response 3
++ MMC_STRPCL = 0x00000002;//start clock
++ while ((MMC_STAT & 0x00002000) == 0x00000000);//wait for end_cmd_res
++
++ //read response FIFO
++ response = MMC_RES & 0x0000ffff ;
++ ignore = MMC_RES ;
++ ignore = MMC_RES ;
++ }
++
++ return 0 ;
++}
++
++#ifdef DEBUG
++static void print_mmc_csd( struct mmc_csd *csd )
++{
++ printf( "ecc: %u\n", csd->ecc );
++ printf( "file_format: %u\n", csd->file_format );
++ printf( "tmp_write_protect: %u\n", csd->tmp_write_protect );
++ printf( "perm_write_protect: %u\n", csd->perm_write_protect );
++ printf( "copy: %u\n", csd->copy );
++ printf( "file_format_grp: %u\n", csd->file_format_grp );
++ printf( "content_prot_app: %u\n", csd->content_prot_app );
++ printf( "rsvd3: %u\n", csd->rsvd3 );
++ printf( "write_bl_partial: %u\n", csd->write_bl_partial );
++ printf( "write_bl_len: %u\n", csd->write_bl_len );
++ printf( "r2w_factor: %u\n", csd->r2w_factor );
++ printf( "default_ecc: %u\n", csd->default_ecc );
++ printf( "wp_grp_enable: %u\n", csd->wp_grp_enable );
++ printf( "wp_grp_size: %u\n", csd->wp_grp_size );
++ printf( "erase_grp_mult: %u\n", csd->erase_grp_mult );
++ printf( "erase_grp_size: %u\n", csd->erase_grp_size );
++ printf( "c_size_mult1: %u\n", csd->c_size_mult1 );
++ printf( "vdd_w_curr_max: %u\n", csd->vdd_w_curr_max );
++ printf( "vdd_w_curr_min: %u\n", csd->vdd_w_curr_min );
++ printf( "vdd_r_curr_max: %u\n", csd->vdd_r_curr_max );
++ printf( "vdd_r_curr_min: %u\n", csd->vdd_r_curr_min );
++ printf( "c_size: %u\n", csd->c_size );
++ printf( "rsvd2: %u\n", csd->rsvd2 );
++ printf( "dsr_imp: %u\n", csd->dsr_imp );
++ printf( "read_blk_misalign: %u\n", csd->read_blk_misalign );
++ printf( "write_blk_misalign: %u\n", csd->write_blk_misalign );
++ printf( "read_bl_partial: %u\n", csd->read_bl_partial );
++ printf( "read_bl_len: %u\n", csd->read_bl_len );
++ printf( "ccc: %u\n", csd->ccc );
++ printf( "tran_speed %u\n", csd->tran_speed );
++ printf( "nsac; %u\n", csd->nsac );
++ printf( "taac; %u\n", csd->taac );
++ printf( "rsvd1: %u\n", csd->rsvd1 );
++ printf( "spec_vers: %u\n", csd->spec_vers );
++ printf( "csd_structure: %u\n", csd->csd_structure );
++}
++#endif
++
++#define DOS_PART_MAGIC_OFFSET 0x1fe
++#define DOS_FS_TYPE_OFFSET 0x36
++#define MSDOS_LABEL_MAGIC1 0x55
++#define MSDOS_LABEL_MAGIC2 0xAA
++
++struct bpb { // see http://staff.washington.edu/dittrich/misc/fatgen103.pdf
++ unsigned char jump[3];
++ char oemName[8];
++ unsigned short bytesPerSector ;
++ unsigned char sectorsPerCluster ;
++ unsigned short reservedSectorCount ;
++ unsigned char numFats ;
++ unsigned short rootEntCount ;
++ unsigned short totalSec16 ;
++ unsigned char media ; // 0xF8
++ unsigned short fatSz16 ;
++ unsigned short secPerTrack ;
++ unsigned short numHeads ;
++ unsigned long hiddenSectors ;
++ unsigned long totalSectors32 ;
++ unsigned char driveNum ;
++ unsigned char reserved1 ; // 0x00
++ unsigned char bootSig ; // 0x29
++ unsigned long volumeId ;
++ char volumeLabel[11];
++ char fileSysType[8];
++} __attribute__((packed));
++
++#define isprint(__c) (((__c)>=0x20)&&((__c)<=0x7f))
++
++static int find_mbr( int max_blocks )
++{
++ int i ;
++ ulong addr = 0 ;
++
++printf( "---- searching %d blocks for MBR\n", max_blocks );
++
++ for( i = 0 ; i < 10 ; i++, addr += MMC_BLOCK_SIZE )
++ {
++ uchar data[MMC_BLOCK_SIZE];
++ if( 0 == mmc_block_read(data, addr, sizeof(data) ))
++ {
++ memcpy( &part, data+0x1be, sizeof(part));
++ if( ( data[DOS_PART_MAGIC_OFFSET] == MSDOS_LABEL_MAGIC1 )
++ &&
++ ( data[DOS_PART_MAGIC_OFFSET + 1] == MSDOS_LABEL_MAGIC2 ) )
++ {
++ if( ( ('\x00' == part.boot_ind )
++ ||
++ ('\x80' == part.boot_ind ) )
++ &&
++ ( 10 > part.head )
++ &&
++ ( part.end_head >= part.head ) )
++ {
++ printf( "partition info found at block %u\n", i );
++ printf( "boot:%02x head:%02x sec:%02x cyl:%02x sys:%02x endh:%02x ends:%02x endc:%02x start:%08x, count:%08x\n",
++ part.boot_ind, part.head, part.sector, part.cyl,
++ part.sys_ind, part.end_head, part.end_sector, part.end_cyl,
++ part.start_sect, part.nr_sects );
++ printf( "MBR found at block %d\n", i );
++ return part.start_sect ;
++ }
++ else {
++ struct bpb const *bootParams = (struct bpb *)data ;
++ unsigned j ;
++ for( j = 0 ; j < sizeof(data); j++ )
++ {
++ if( 0 == ( j & 0x0f ) )
++ printf( "%04x ", j );
++ printf( "%02x ", data[j] );
++ if( 7 == ( j & 7 ) )
++ printf( " " );
++ if( 0x0f == ( j & 0x0f ) )
++ {
++ unsigned b ;
++ for( b = j-15 ; b <= j ; b++ )
++ {
++ uchar c = data[b];
++ if( isprint(c) )
++ printf( "%c", c );
++ else
++ printf( "." );
++ if( 7 == ( b & 7 ) )
++ printf( " " );
++ }
++ printf( "\n" );
++ }
++ }
++ printf( "Invalid MBR\n" );
++ printf( "---> Boot Parameter block\n" );
++ printf( "jump %02x %02x %02x\n", bootParams->jump[0],bootParams->jump[1],bootParams->jump[2]);
++ printf( "bytesPerSector: %04x\n", bootParams->bytesPerSector );
++ printf( "sectorsPerCluster: %02x\n", bootParams->sectorsPerCluster );
++ printf( "reservedSectors %04x\n", bootParams->reservedSectorCount );
++ printf( "numFats: %02x\n", bootParams->numFats );
++ printf( "rootEntCount: %04x\n", bootParams->rootEntCount );
++ printf( "totalSec16: %04x\n", bootParams->totalSec16 );
++ printf( "media: %02x\n", bootParams->media );
++ printf( "fatsz16: %04x", bootParams->fatSz16 );
++ printf( "secPerTrack: %04x\n", bootParams->secPerTrack );
++ printf( "numHeads = %04x\n", bootParams->numHeads );
++ printf( "hidden = %08lx\n", bootParams->hiddenSectors );
++ printf( "totalSec32 = %08lx\n", bootParams->totalSectors32 );
++ printf( "drive #%u\n", bootParams->driveNum );
++ printf( "reserved1: %02x\n", bootParams->reserved1 );
++ printf( "bootSig: %02x\n", bootParams->bootSig );
++ printf( "volume: %08lx\n", bootParams->volumeId );
++ part.boot_ind = 0 ;
++ part.head = 0 ;
++ part.sector = 2 ;
++ part.cyl = 0 ;
++ part.sys_ind = 6 ;
++ part.end_head = bootParams->numHeads ;
++ part.end_sector = 0xe0 ;
++ part.end_cyl = 0xc9 ;
++ part.start_sect = 0 ;
++ part.nr_sects = bootParams->totalSectors32 ;
++ printf( "partition info found at block %u\n", i );
++ printf( "boot:%02x head:%02x sec:%02x cyl:%02x sys:%02x endh:%02x ends:%02x endc:%02x start:%08x, count:%08x\n",
++ part.boot_ind, part.head, part.sector, part.cyl,
++ part.sys_ind, part.end_head, part.end_sector, part.end_cyl,
++ part.start_sect, part.nr_sects );
++ printf( "MBR found at block %d\n", i );
++ return 0 ;
++ }
++ }
++ }
++ else
++ {
++ printf( "!!! Error reading mmc block %u\n", i );
++ break;
++ }
++ }
++
++ printf( "MBR not found!\n" );
++ return -1 ;
++}
++
+ int
+ /****************************************************/
+ mmc_init(int verbose)
+@@ -406,7 +741,8 @@
+ {
+ int retries, rc = -ENODEV;
+ uchar *resp;
+-
++ mmc_cid_t *cid ;
++ mmc_csd_t *csd ;
+ #ifdef CONFIG_LUBBOCK
+ set_GPIO_mode( GPIO6_MMCCLK_MD );
+ set_GPIO_mode( GPIO8_MMCCS0_MD );
+@@ -419,23 +755,63 @@
+ MMC_RESTO = MMC_RES_TO_MAX;
+ MMC_SPI = MMC_SPI_DISABLE;
+
++ if( 0 == SDCard_test() )
++ {
++ printf( "SD card detected!\n" );
++ isSD = 1 ;
++ }
++ else
++ {
++ isSD = 0 ;
++
+ /* reset */
+- retries = 10;
+- resp = mmc_cmd(0, 0, 0, 0);
++ mmc_cmd(0, 0, 0, 0);
+ resp = mmc_cmd(1, 0x00ff, 0xc000, MMC_CMDAT_INIT|MMC_CMDAT_BUSY|MMC_CMDAT_R3);
+- while (retries-- && resp && !(resp[4] & 0x80))
++ if( 0 == resp )
++ {
++ printf( "MMC CMD1 error\n" );
++ return -1 ;
++ }
++
++ printf( "init: " ); dumpResponse( resp, 6 );
++ retries = 0 ;
++ do
+ {
+- debug("resp %x %x\n", resp[0], resp[1]);
+- udelay(50);
++ udelay(100);
+ resp = mmc_cmd(1, 0x00ff, 0xff00, MMC_CMDAT_BUSY|MMC_CMDAT_R3);
++ debug( "cmd1: " ); dumpResponse( resp, 6 );
++ retries++ ;
++ } while( resp && ( 0 == ( resp[4] & 0x80 ) ) );
++
++ if( 0 == resp )
++ {
++ printf( "MMC CMD1 error2\n" );
++ return -1 ;
++ }
++
++ do {
++ udelay(100);
++ resp = mmc_cmd(1, 0x00ff, 0xff00, MMC_CMDAT_BUSY|MMC_CMDAT_R3);
++ debug( "cmd1: " ); dumpResponse( resp, 6 );
++ retries++ ;
++ } while( resp && ( 0 != ( resp[4] & 0x80 ) ) );
++
++ printf( "after busy: %s, %d retries\n",
++ resp ? "have INIT response"
++ : "no INIT response",
++ retries );
+ }
+
+ /* try to get card id */
+ resp = mmc_cmd(2, 0, 0, MMC_CMDAT_R2);
+- if (resp)
++ if( !resp )
+ {
++ printf( "Bad CMDAT_R2 response\n" );
++ return -1 ;
++ }
++
+ /* TODO configure mmc driver depending on card attributes */
+- mmc_cid_t *cid = (mmc_cid_t *)resp;
++ cid = (mmc_cid_t *)resp;
+ if (verbose)
+ {
+ printf("MMC found. Card desciption is:\n");
+@@ -449,6 +825,12 @@
+ printf("Month = %d\n",cid->month);
+ printf("Year = %d\n",1997 + cid->year);
+ }
++ sprintf(mmc_dev.product,"%s",cid->name);
++ sprintf(mmc_dev.vendor,"Man %02x%02x%02x Snr %02x%02x%02x",
++ cid->id[0], cid->id[1], cid->id[2],
++ cid->sn[0], cid->sn[1], cid->sn[2]);
++ sprintf(mmc_dev.revision,"%x %x",cid->hwrev, cid->fwrev);
++
+ /* fill in device description */
+ mmc_dev.if_type = IF_TYPE_MMC;
+ mmc_dev.dev = 0;
+@@ -457,30 +839,118 @@
+ /* FIXME fill in the correct size (is set to 32MByte) */
+ mmc_dev.blksz = 512;
+ mmc_dev.lba = 0x10000;
+- sprintf(mmc_dev.vendor,"Man %02x%02x%02x Snr %02x%02x%02x",
+- cid->id[0], cid->id[1], cid->id[2],
+- cid->sn[0], cid->sn[1], cid->sn[2]);
+- sprintf(mmc_dev.product,"%s",cid->name);
+- sprintf(mmc_dev.revision,"%x %x",cid->hwrev, cid->fwrev);
+ mmc_dev.removable = 0;
+ mmc_dev.block_read = mmc_bread;
+
+ /* MMC exists, get CSD too */
+ resp = mmc_cmd(MMC_CMD_SET_RCA, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R1);
+- resp = mmc_cmd(MMC_CMD_SEND_CSD, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R2);
+- if (resp)
++
++ if( resp )
+ {
+- mmc_csd_t *csd = (mmc_csd_t *)resp;
+- memcpy(&mmc_csd, csd, sizeof(csd));
+- rc = 0;
+- mmc_ready = 1;
+- /* FIXME add verbose printout for csd */
++ if( isSD )
++ RCA = ((ushort)resp[4] << 8 ) | resp[3];
++ else
++ RCA = MMC_DEFAULT_RCA ;
+ }
++ else
++ {
++ printf( "no SET_RCA response\n" );
++ return -1 ;
+ }
+
++#if 0
++/*
++ * According to a Toshiba doc, the following is supposed to give
++ * the size of the 'protected' area (so we can ignore it).
++
++ * Unfortunately, I can't get the numbers to add up, so we walk
++ * til we find an MBR instead.
++ */
++ if( isSD )
++ {
++ printf( "sending CMD55\n" );
++ resp = mmc_cmd(SD_APP_CMD55, RCA, 0, MMC_CMDAT_R1);
++ if( !resp )
++ {
++ printf( "Error 0x%04x sending APP CMD\n", MMC_STAT );
++ return -1 ;
++ }
++ else
++ {
++ printf( "have CMD55 response\n" );
++ memset( resp, 0, 20 );
++ }
++
++ resp = mmc_cmd(SD_STATUS, RCA, 0, MMC_CMDAT_R1 );
++ if( resp )
++ {
++ sd_status_t *status ;
++ int i ;
++ printf( "SDSTATUS returned\n" );
++ for( i = 0 ; i < 16 ; i++ )
++ printf( "%02x ", resp[i] );
++ printf( "\n" );
++ status = (sd_status_t *)resp ;
++ printf( "bus_width: %u\n", status->bus_width );
++ printf( "secured_mode: %u\n", status->secured_mode );
++ printf( "unused0: %x\n", status->unused0 );
++ printf( "card_type: %x\n", status->card_type );
++ printf( "prot_size: %lx\n", status->prot_size );
++ }
++ else
++ {
++ printf( "Error reading SD_STATUS\n" );
++ return -1 ;
++ }
++ }
++#endif
++
++ MMC_STRPCL = MMC_STRPCL_STOP_CLK;
++ MMC_I_MASK = ~MMC_I_MASK_CLK_IS_OFF;
++ while (!(MMC_I_REG & MMC_I_REG_CLK_IS_OFF));
++
+ MMC_CLKRT = 0; /* 20 MHz */
+- resp = mmc_cmd(7, MMC_DEFAULT_RCA, 0, MMC_CMDAT_R1);
++ resp = mmc_cmd(7, RCA, 0, MMC_CMDAT_R1);
++ if( !resp )
++ {
++ printf( "Error selecting RCA %x\n", RCA );
++ return -1 ;
++ }
++
++ resp = mmc_cmd(7, 0, 0, MMC_CMDAT_R1);
++ if( !resp )
++ {
++ // this is normal
++ }
++
++ resp = mmc_cmd(MMC_CMD_SEND_CSD, RCA, 0, MMC_CMDAT_R2);
++ if (!resp)
++ {
++ printf( "Error reading CSD\n" );
++ return -1 ;
++ }
++
++ csd = (mmc_csd_t *)resp;
++ memcpy(&mmc_csd, csd, sizeof(*csd));
++ rc = 0;
++
++#ifdef DEBUG
++ dumpResponse( resp, sizeof( *csd ) );
++ print_mmc_csd( csd );
++#endif
++
++ resp = mmc_cmd(7, RCA, 0, MMC_CMDAT_R1);
++ if( !resp )
++ {
++ printf( "Error selecting RCA %x\n", RCA );
++ return -1 ;
++ }
++
++ mmc_ready = 1;
++ startBlock = find_mbr(mmc_csd.c_size);
+
++ printf( "registering device: startBlock == %d, isSD ? %s\n",
++ startBlock, isSD ? "yes" : "no" );
+ fat_register_device(&mmc_dev,1); /* partitions start counting with 1 */
+
+ return rc;
+@@ -503,4 +973,41 @@
+ return 0;
+ }
+
++#if (CONFIG_COMMANDS & CFG_CMD_MMC)
++
++int do_mmc_detect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ unsigned long gplr1 = GPLR1 ;
++ int rval = ( 0 != (gplr1 & 0x10) );
++#ifdef DEBUG
++ printf ("Checking for MMC card: %lx, %d\n", gplr1, rval );
++#endif
++ return rval ;
++}
++
++U_BOOT_CMD(
++ mmcdet, 1, 0, do_mmc_detect,
++ "mmcdet - detect mmc card\n",
++ NULL
++);
++
++int do_mmc_wp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ unsigned long gplr1 = GPLR1 ;
++ int rval = ( 0 == (gplr1 & 0x40) );
++#ifdef DEBUG
++ printf ("Checking MMC write protect: %lx, %d\n", gplr1, rval );
++#endif
++ return rval ;
++}
++
++U_BOOT_CMD(
++ mmcwp, 1, 0, do_mmc_wp,
++ "mmcwp - detect mmc write protect\n",
++ NULL
++);
++
++#endif
++
+ #endif
++
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/pxafb.c u-boot-1.1.2-neon/cpu/pxa/pxafb.c
+--- u-boot-1.1.2/cpu/pxa/pxafb.c 2004-10-10 01:26:00.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/pxa/pxafb.c 2007-08-11 21:07:20.000000000 +0200
+@@ -36,6 +36,10 @@
+ #include <lcd.h>
+ #include <asm/arch/pxa-regs.h>
+
++#ifdef CFG_CMD_LCDPANEL
++#include <lcd_panels.h>
++#endif
++
+ /* #define DEBUG */
+
+ #ifdef CONFIG_LCD
+@@ -147,6 +151,38 @@
+ #endif /* CONFIG_HITACHI_SX14 */
+
+ /*----------------------------------------------------------------------*/
++#ifdef CONFIG_SHARP_QVGA
++/* Sharp 1/4 VGA LCD */
++#define LCD_BPP LCD_COLOR8
++
++/* you have to set lccr0 and lccr3 (including pcd) */
++#define REG_LCCR0 0x003008F8
++#define REG_LCCR3 (0x0040FF0C|(LCD_BPP<<24))
++
++vidinfo_t panel_info = {
++ vl_col: 320,
++ vl_row: 240,
++ vl_width: 167,
++ vl_height: 109,
++ vl_clkp: CFG_HIGH,
++ vl_oep: CFG_HIGH,
++ vl_hsp: CFG_HIGH,
++ vl_vsp: CFG_HIGH,
++ vl_dp: CFG_HIGH,
++ vl_bpix: LCD_BPP,
++ vl_lbw: 1,
++ vl_splt: 0,
++ vl_clor: 1,
++ vl_tft: 1,
++ vl_hpw: 64,
++ vl_blw: 34,
++ vl_elw: 1,
++ vl_vpw: 20,
++ vl_bfw: 8,
++ vl_efw: 3,
++};
++#endif /* CONFIG_SHARP_QVGA */
++
+
+ #if LCD_BPP == LCD_COLOR8
+ void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue);
+@@ -163,7 +199,6 @@
+ void lcd_ctrl_init (void *lcdbase);
+ void lcd_enable (void);
+
+-int lcd_line_length;
+ int lcd_color_fg;
+ int lcd_color_bg;
+
+@@ -185,10 +220,28 @@
+
+ void lcd_ctrl_init (void *lcdbase)
+ {
++#ifdef CFG_CMD_LCDPANEL
++ char const *panelName = getenv( "panel" );
++ if( panelName )
++ {
++ struct lcd_panel_info_t const *panel ;
++ panel = find_lcd_panel( panelName );
++ if( panel )
++ {
++ printf( "panel %s found: %u x %u\n", panelName, panel->xres, panel->yres );
++ panel_info.pxa.screen = (u_long)lcdbase;
++ set_lcd_panel( panel );
++ }
++ else
++ printf( "panel %s not found\n", panelName );
++ }
++#else
+ pxafb_init_mem(lcdbase, &panel_info);
+ pxafb_init(&panel_info);
+ pxafb_setup_gpio(&panel_info);
+ pxafb_enable_controller(&panel_info);
++#endif
++
+ }
+
+ /*----------------------------------------------------------------------*/
+@@ -204,6 +257,7 @@
+ void
+ lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue)
+ {
++#if defined( CONFIG_PXA250 )
+ struct pxafb_info *fbi = &panel_info.pxa;
+ unsigned short *palette = (unsigned short *)fbi->palette;
+ u_int val;
+@@ -219,7 +273,22 @@
+ palette[regno] = val;
+ #endif
+ }
++#elif defined( CONFIG_PXA270 )
++ struct pxafb_info *fbi = &panel_info.pxa;
++ u32 *palette = (u32 *)fbi->palette;
++ u32 val;
++
++ if (regno < fbi->palette_size) {
++ val = 0xFF000000 ; // transparency
++ val |= (red << 16);
++ val |= (green << 8);
++ val |= blue ;
+
++ palette[regno] = val;
++ }
++#else
++#error no processor defined
++#endif
+ debug ("setcolreg: reg %2d @ %p: R=%02X G=%02X B=%02X => %04X\n",
+ regno, &palette[regno],
+ red, green, blue,
+@@ -284,7 +353,7 @@
+ fbi->screen = (u_long)lcdbase;
+
+ fbi->palette_size = NBITS(vid->vl_bpix) == 8 ? 256 : 16;
+- palette_mem_size = fbi->palette_size * sizeof(u16);
++ palette_mem_size = fbi->palette_size * sizeof(PALETTEVAL_TYPE);
+
+ debug("palette_mem_size = 0x%08lx\n", (u_long) palette_mem_size);
+ /* locate palette and descs at end of page following fb */
+@@ -376,11 +445,16 @@
+ static int pxafb_init (vidinfo_t *vid)
+ {
+ struct pxafb_info *fbi = &vid->pxa;
++ unsigned long const REG_LCCR3 = 0x0040FF0C|(LCD_BPP<<24);
+
+ debug("Configuring PXA LCD\n");
+
+- fbi->reg_lccr0 = REG_LCCR0;
+- fbi->reg_lccr3 = REG_LCCR3;
++#if defined( CONFIG_PXA270 )
++ LCCR4 = 0x00010000 ;
++#endif
++
++ fbi->reg_lccr0 = 0x003008F8;
++ fbi->reg_lccr3 = REG_LCCR3 ;
+
+ debug("vid: vl_col=%d hslen=%d lm=%d rm=%d\n",
+ vid->vl_col, vid->vl_hpw,
+@@ -429,7 +503,7 @@
+
+ fbi->dmadesc_palette->fsadr = fbi->palette;
+ fbi->dmadesc_palette->fidr = 0;
+- fbi->dmadesc_palette->ldcmd = (fbi->palette_size * 2) | LDCMD_PAL;
++ fbi->dmadesc_palette->ldcmd = (fbi->palette_size * sizeof(PALETTEVAL_TYPE)) | LDCMD_PAL;
+
+ if( NBITS(vid->vl_bpix) < 12)
+ {
+@@ -465,6 +539,39 @@
+ return 0;
+ }
+
++
++#ifdef CFG_CMD_LCDPANEL
++
++void set_lcd_panel( struct lcd_panel_info_t const *panel )
++{
++ panel_info.vl_col = panel->xres ;
++ panel_info.vl_row = panel->yres ;
++ panel_info.vl_clkp = panel->act_high ;
++ panel_info.vl_oep = panel->act_high ;
++ panel_info.vl_hsp = panel->act_high ;
++ panel_info.vl_vsp = panel->act_high ;
++ panel_info.vl_dp = panel->act_high ;
++ panel_info.vl_bpix = LCD_BPP ;
++ panel_info.vl_lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) >> 3;
++ panel_info.vl_lbw = 1 ;
++ panel_info.vl_splt = 0 ;
++ panel_info.vl_clor = 1 ;
++ panel_info.vl_tft = panel->active ;
++ panel_info.vl_hpw = panel->hsync_len ;
++ panel_info.vl_blw = panel->left_margin ;
++ panel_info.vl_elw = panel->right_margin ;
++ panel_info.vl_vpw = panel->vsync_len ;
++ panel_info.vl_bfw = panel->upper_margin ;
++ panel_info.vl_efw = panel->lower_margin ;
++
++ pxafb_init_mem( (void *)panel_info.pxa.screen, &panel_info);
++ pxafb_init(&panel_info);
++ pxafb_setup_gpio(&panel_info);
++ pxafb_enable_controller(&panel_info);
++}
++
++#endif // dynamic LCD panel support
++
+ /************************************************************************/
+ /************************************************************************/
+
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/sm501_usb.h u-boot-1.1.2-neon/cpu/pxa/sm501_usb.h
+--- u-boot-1.1.2/cpu/pxa/sm501_usb.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/sm501_usb.h 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,66 @@
++#ifndef SM501_USB_INCLUDED
++#define SM501_USB_INCLUDED
++
++ #if defined(CONFIG_SM501)
++ #define USB_GATE_MODE0 __REG(0xFE00040)
++ #define USB_GATE_MODE1 __REG(0xFE00048)
++ #define ENABLE_USBH (1<<11)
++
++ /*
++ * USB Host Controller
++ */
++ #define USBH_BASE 0xFE40000
++ #define UHCREV __REG(0xFE40000)
++ #define UHCHCON __REG(0xFE40004)
++ #define UHCCOMS __REG(0xFE40008)
++ #define UHCINTS __REG(0xFE4000C)
++ #define UHCINTE __REG(0xFE40010)
++ #define UHCINTD __REG(0xFE40014)
++ #define UHCHCCA __REG(0xFE40018)
++ #define UHCPCED __REG(0xFE4001C)
++ #define UHCCHED __REG(0xFE40020)
++ #define UHCCCED __REG(0xFE40024)
++ #define UHCBHED __REG(0xFE40028)
++ #define UHCBCED __REG(0xFE4002C)
++ #define UHCDHEAD __REG(0xFE40030)
++ #define UHCFMI __REG(0xFE40034)
++ #define UHCFMR __REG(0xFE40038)
++ #define UHCFMN __REG(0xFE4003C)
++ #define UHCPERS __REG(0xFE40040)
++ #define UHCLST __REG(0xFE40044)
++ #define UHCRHDA __REG(0xFE40048)
++ #define UHCRHDB __REG(0xFE4004C)
++ #define UHCRHS __REG(0xFE40050)
++ #define UHCRHPS1 __REG(0xFE40054)
++ #define UHCRHPS2 __REG(0xFE40058)
++ #define UHCRHPS3 __REG(0xFE4005C)
++ #define UHCSTAT __REG(0xFE40060)
++ #define UHCHR __REG(0xFE40064)
++ #define UHCHIE __REG(0xFE40068)
++ #define UHCHIT __REG(0xFE4006C)
++
++ #define UHCHR_FSBIR (1<<0)
++ #define UHCHR_FHR (1<<1)
++ #define UHCHR_CGR (1<<2)
++ #define UHCHR_SSDC (1<<3)
++ #define UHCHR_UIT (1<<4)
++ #define UHCHR_SSE (1<<5)
++ #define UHCHR_PSPL (1<<6)
++ #define UHCHR_PCPL (1<<7)
++ #define UHCHR_SSEP0 (1<<9)
++ #define UHCHR_SSEP1 (1<<10)
++ #define UHCHR_SSEP2 (1<<11)
++
++ #define UHCHIE_UPRIE (1<<13)
++ #define UHCHIE_UPS2IE (1<<12)
++ #define UHCHIE_UPS1IE (1<<11)
++ #define UHCHIE_TAIE (1<<10)
++ #define UHCHIE_HBAIE (1<<8)
++ #define UHCHIE_RWIE (1<<7)
++
++ #define UHCCOMS_HCR 1
++ #define UHCRHS_LPS 1
++ #define UHCHR_SSE (1<<5)
++
++ #endif
++#endif
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/start.S u-boot-1.1.2-neon/cpu/pxa/start.S
+--- u-boot-1.1.2/cpu/pxa/start.S 2004-06-09 02:11:02.000000000 +0200
++++ u-boot-1.1.2-neon/cpu/pxa/start.S 2007-08-11 21:07:20.000000000 +0200
+@@ -61,23 +61,10 @@
+ * - jump to second stage
+ */
+
+-_TEXT_BASE:
+- .word TEXT_BASE
+
+-.globl _armboot_start
+-_armboot_start:
+- .word _start
++_textBase:
++ .word TEXT_BASE
+
+-/*
+- * These are defined in the board-specific linker script.
+- */
+-.globl _bss_start
+-_bss_start:
+- .word __bss_start
+-
+-.globl _bss_end
+-_bss_end:
+- .word _end
+
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+@@ -111,47 +98,9 @@
+ #ifdef CONFIG_INIT_CRITICAL
+ bl cpu_init_crit /* we do sys-critical inits */
+ #endif
++ b HeadStart
+
+-relocate: /* relocate U-Boot to RAM */
+- adr r0, _start /* r0 <- current position of code */
+- ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
+- cmp r0, r1 /* don't reloc during debug */
+- beq stack_setup
+-
+- ldr r2, _armboot_start
+- ldr r3, _bss_start
+- sub r2, r3, r2 /* r2 <- size of armboot */
+- add r2, r0, r2 /* r2 <- source end address */
+-
+-copy_loop:
+- ldmia r0!, {r3-r10} /* copy from source address [r0] */
+- stmia r1!, {r3-r10} /* copy to target address [r1] */
+- cmp r0, r2 /* until source end addreee [r2] */
+- ble copy_loop
+-
+- /* Set up the stack */
+-stack_setup:
+- ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
+- sub r0, r0, #CFG_MALLOC_LEN /* malloc area */
+- sub r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
+-#ifdef CONFIG_USE_IRQ
+- sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
+-#endif
+- sub sp, r0, #12 /* leave 3 words for abort-stack */
+-
+-clear_bss:
+- ldr r0, _bss_start /* find start of bss segment */
+- ldr r1, _bss_end /* stop here */
+- mov r2, #0x00000000 /* clear */
+
+-clbss_l:str r2, [r0] /* clear loop... */
+- add r0, r0, #4
+- cmp r0, r1
+- bne clbss_l
+-
+- ldr pc, _start_armboot
+-
+-_start_armboot: .word start_armboot
+
+
+ /****************************************************************************/
+@@ -167,16 +116,7 @@
+ IC_BASE: .word 0x40d00000
+ #define ICMR 0x04
+
+-/* Reset-Controller */
+-RST_BASE: .word 0x40f00030
+-#define RCSR 0x00
+-
+-/* Operating System Timer */
+-OSTIMER_BASE: .word 0x40a00000
+-#define OSMR3 0x0C
+-#define OSCR 0x10
+-#define OWER 0x18
+-#define OIER 0x1C
++
+
+ /* Clock Manager Registers */
+ #ifdef CFG_CPUSPEED
+@@ -288,7 +228,7 @@
+ stmia sp, {r0 - r12} /* Calling r0-r12 */
+ add r8, sp, #S_PC
+
+- ldr r2, _armboot_start
++ ldr r2, _textBase
+ sub r2, r2, #(CONFIG_STACKSIZE+CFG_MALLOC_LEN)
+ sub r2, r2, #(CFG_GBL_DATA_SIZE+8) @ set base 2 words into abort stack
+ ldmia r2, {r2 - r4} /* get pc, cpsr, old_r0 */
+@@ -325,7 +265,7 @@
+ .endm
+
+ .macro get_bad_stack
+- ldr r13, _armboot_start @ setup our mode stack
++ ldr r13, _textBase @ setup our mode stack
+ sub r13, r13, #(CONFIG_STACKSIZE+CFG_MALLOC_LEN)
+ sub r13, r13, #(CFG_GBL_DATA_SIZE+8) @ reserved a couple spots in abort stack
+
+@@ -416,36 +356,3 @@
+
+ #endif
+
+-/****************************************************************************/
+-/* */
+-/* Reset function: the PXA250 doesn't have a reset function, so we have to */
+-/* perform a watchdog timeout for a soft reset. */
+-/* */
+-/****************************************************************************/
+-
+- .align 5
+-.globl reset_cpu
+-
+- /* FIXME: this code is PXA250 specific. How is this handled on */
+- /* other XScale processors? */
+-
+-reset_cpu:
+-
+- /* We set OWE:WME (watchdog enable) and wait until timeout happens */
+-
+- ldr r0, OSTIMER_BASE
+- ldr r1, [r0, #OWER]
+- orr r1, r1, #0x0001 /* bit0: WME */
+- str r1, [r0, #OWER]
+-
+- /* OS timer does only wrap every 1165 seconds, so we have to set */
+- /* the match register as well. */
+-
+- ldr r1, [r0, #OSCR] /* read OS timer */
+- add r1, r1, #0x800 /* let OSMR3 match after */
+- add r1, r1, #0x800 /* 4096*(1/3.6864MHz)=1ms */
+- str r1, [r0, #OSMR3]
+-
+-reset_endless:
+-
+- b reset_endless
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/usb_ohci.c u-boot-1.1.2-neon/cpu/pxa/usb_ohci.c
+--- u-boot-1.1.2/cpu/pxa/usb_ohci.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/usb_ohci.c 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,1679 @@
++/*
++ * URB OHCI HCD (Host Controller Driver) for USB on the S3C2400.
++ *
++ * (C) Copyright 2003
++ * Gary Jennejohn, DENX Software Engineering <gj@denx.de>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * 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
++ *
++ * Note: Part of this code has been derived from linux
++ *
++ */
++/*
++ * IMPORTANT NOTES
++ * 1 - you MUST define LITTLEENDIAN in the configuration file for the
++ * board or this driver will NOT work!
++ * 2 - this driver is intended for use with USB Mass Storage Devices
++ * (BBB) ONLY. There is NO support for Interrupt or Isochronous pipes!
++ */
++
++#include <common.h>
++/* #include <pci.h> no PCI on the S3C24X0 */
++
++#ifdef CONFIG_USB_OHCI
++
++#include <asm/arch/pxa-regs.h>
++
++#include <malloc.h>
++#include <usb.h>
++#include "usb_ohci.h"
++
++#if defined( CONFIG_SM501 )
++#include "sm501_usb.h"
++#endif
++
++// #define OHCI_USE_NPS /* force NoPowerSwitching mode */
++// #define OHCI_VERBOSE_DEBUG /* not always helpful */
++
++
++/* For initializing controller (mask in an HCFS mode too) */
++#define OHCI_CONTROL_INIT \
++ (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
++
++#define readl(a) (*((vu_long *)(a)))
++#define writel(a, b) (*((vu_long *)(b)) = ((vu_long)a))
++
++#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
++
++//#define DEBUG
++#ifdef DEBUG
++#define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg)
++#else
++#define dbg(format, arg...) do {} while(0)
++#endif /* DEBUG */
++#define err(format, arg...) printf("ERROR: " format "\n", ## arg)
++#define SHOW_INFO
++#ifdef SHOW_INFO
++#define info(format, arg...) printf("INFO: " format "\n", ## arg)
++#else
++#define info(format, arg...) do {} while(0)
++#endif
++
++#define m16_swap(x) swap_16(x)
++#define m32_swap(x) swap_32(x)
++
++/* global ohci_t */
++static ohci_t gohci;
++/* this must be aligned to a 256 byte boundary */
++struct ohci_hcca ghcca[1];
++/* a pointer to the aligned storage */
++struct ohci_hcca *phcca;
++/* this allocates EDs for all possible endpoints */
++struct ohci_device ohci_dev;
++/* urb_priv */
++urb_priv_t urb_priv;
++/* RHSC flag */
++int got_rhsc;
++/* device which was disconnected */
++struct usb_device *devgone;
++
++/*-------------------------------------------------------------------------*/
++
++/* AMD-756 (D2 rev) reports corrupt register contents in some cases.
++ * The erratum (#4) description is incorrect. AMD's workaround waits
++ * till some bits (mostly reserved) are clear; ok for all revs.
++ */
++#define OHCI_QUIRK_AMD756 0xabcd
++#define read_roothub(hc, register, mask) ({ \
++ u32 temp = readl (&hc->regs->roothub.register); \
++ if (hc->flags & OHCI_QUIRK_AMD756) \
++ while (temp & mask) \
++ temp = readl (&hc->regs->roothub.register); \
++ temp; })
++
++static u32 roothub_a (struct ohci *hc)
++ { return read_roothub (hc, a, 0xfc0fe000); }
++static inline u32 roothub_b (struct ohci *hc)
++ { return readl (&hc->regs->roothub.b); }
++static inline u32 roothub_status (struct ohci *hc)
++ { return readl (&hc->regs->roothub.status); }
++static u32 roothub_portstatus (struct ohci *hc, int i)
++ { return read_roothub (hc, portstatus [i], 0xffe0fce0); }
++
++
++/* forward declaration */
++static int hc_interrupt (void);
++static void
++td_submit_job (struct usb_device * dev, unsigned long pipe, void * buffer,
++ int transfer_len, struct devrequest * setup, urb_priv_t * urb, int interval);
++
++/*-------------------------------------------------------------------------*
++ * URB support functions
++ *-------------------------------------------------------------------------*/
++
++/* free HCD-private data associated with this URB */
++
++static void urb_free_priv (urb_priv_t * urb)
++{
++ int i;
++ int last;
++ struct td * td;
++
++ last = urb->length - 1;
++ if (last >= 0) {
++ for (i = 0; i <= last; i++) {
++ td = urb->td[i];
++ if (td) {
++ td->usb_dev = NULL;
++ urb->td[i] = NULL;
++ }
++ }
++ }
++}
++
++/*-------------------------------------------------------------------------*/
++
++#ifdef DEBUG
++static int sohci_get_current_frame_number (struct usb_device * dev);
++
++/* debug| print the main components of an URB
++ * small: 0) header + data packets 1) just header */
++
++static void pkt_print (struct usb_device * dev, unsigned long pipe, void * buffer,
++ int transfer_len, struct devrequest * setup, char * str, int small)
++{
++ urb_priv_t * purb = &urb_priv;
++
++ dbg("%s URB:[%4x] dev:%2d,ep:%2d-%c,type:%s,len:%d/%d stat:%#lx",
++ str,
++ sohci_get_current_frame_number (dev),
++ usb_pipedevice (pipe),
++ usb_pipeendpoint (pipe),
++ usb_pipeout (pipe)? 'O': 'I',
++ usb_pipetype (pipe) < 2? (usb_pipeint (pipe)? "INTR": "ISOC"):
++ (usb_pipecontrol (pipe)? "CTRL": "BULK"),
++ purb->actual_length,
++ transfer_len, dev->status);
++#ifdef OHCI_VERBOSE_DEBUG
++ if (!small) {
++ int i, len;
++
++ if (usb_pipecontrol (pipe)) {
++ printf (__FILE__ ": cmd(8):");
++ for (i = 0; i < 8 ; i++)
++ printf (" %02x", ((__u8 *) setup) [i]);
++ printf ("\n");
++ }
++ if (transfer_len > 0 && buffer) {
++ printf (__FILE__ ": data(%d/%d):",
++ purb->actual_length,
++ transfer_len);
++ len = usb_pipeout (pipe)?
++ transfer_len: purb->actual_length;
++ for (i = 0; i < 16 && i < len; i++)
++ printf (" %02x", ((__u8 *) buffer) [i]);
++ printf ("%s\n", i < len? "...": "");
++ }
++ }
++#endif
++}
++
++/* just for debugging; prints non-empty branches of the int ed tree inclusive iso eds*/
++void ep_print_int_eds (ohci_t *ohci, char * str) {
++ int i, j;
++ __u32 * ed_p;
++ for (i= 0; i < 32; i++) {
++ j = 5;
++ ed_p = &(ohci->hcca->int_table [i]);
++ if (*ed_p == 0)
++ continue;
++ printf (__FILE__ ": %s branch int %2d(%2x):", str, i, i);
++ while (*ed_p != 0 && j--) {
++ ed_t *ed = (ed_t *)m32_swap(ed_p);
++ printf (" ed: %4x;", ed->hwINFO);
++ ed_p = &ed->hwNextED;
++ }
++ printf ("\n");
++ }
++}
++
++static void ohci_dump_intr_mask (char *label, __u32 mask)
++{
++ dbg ("%s: 0x%08x%s%s%s%s%s%s%s%s%s",
++ label,
++ mask,
++ (mask & OHCI_INTR_MIE) ? " MIE" : "",
++ (mask & OHCI_INTR_OC) ? " OC" : "",
++ (mask & OHCI_INTR_RHSC) ? " RHSC" : "",
++ (mask & OHCI_INTR_FNO) ? " FNO" : "",
++ (mask & OHCI_INTR_UE) ? " UE" : "",
++ (mask & OHCI_INTR_RD) ? " RD" : "",
++ (mask & OHCI_INTR_SF) ? " SF" : "",
++ (mask & OHCI_INTR_WDH) ? " WDH" : "",
++ (mask & OHCI_INTR_SO) ? " SO" : ""
++ );
++}
++
++static void maybe_print_eds (char *label, __u32 value)
++{
++ ed_t *edp = (ed_t *)value;
++
++ if (value) {
++ dbg ("%s %08x", label, value);
++ dbg ("%08x", edp->hwINFO);
++ dbg ("%08x", edp->hwTailP);
++ dbg ("%08x", edp->hwHeadP);
++ dbg ("%08x", edp->hwNextED);
++ }
++}
++
++static char * hcfs2string (int state)
++{
++ switch (state) {
++ case OHCI_USB_RESET: return "reset";
++ case OHCI_USB_RESUME: return "resume";
++ case OHCI_USB_OPER: return "operational";
++ case OHCI_USB_SUSPEND: return "suspend";
++ }
++ return "?";
++}
++
++/* dump control and status registers */
++static void ohci_dump_status (ohci_t *controller)
++{
++ struct ohci_regs *regs = controller->regs;
++ __u32 temp;
++
++ temp = readl (&regs->revision) & 0xff;
++ if (temp != 0x10)
++ dbg ("spec %d.%d", (temp >> 4), (temp & 0x0f));
++
++ temp = readl (&regs->control);
++ dbg ("control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d", temp,
++ (temp & OHCI_CTRL_RWE) ? " RWE" : "",
++ (temp & OHCI_CTRL_RWC) ? " RWC" : "",
++ (temp & OHCI_CTRL_IR) ? " IR" : "",
++ hcfs2string (temp & OHCI_CTRL_HCFS),
++ (temp & OHCI_CTRL_BLE) ? " BLE" : "",
++ (temp & OHCI_CTRL_CLE) ? " CLE" : "",
++ (temp & OHCI_CTRL_IE) ? " IE" : "",
++ (temp & OHCI_CTRL_PLE) ? " PLE" : "",
++ temp & OHCI_CTRL_CBSR
++ );
++
++ temp = readl (&regs->cmdstatus);
++ dbg ("cmdstatus: 0x%08x SOC=%d%s%s%s%s", temp,
++ (temp & OHCI_SOC) >> 16,
++ (temp & OHCI_OCR) ? " OCR" : "",
++ (temp & OHCI_BLF) ? " BLF" : "",
++ (temp & OHCI_CLF) ? " CLF" : "",
++ (temp & OHCI_HCR) ? " HCR" : ""
++ );
++
++ ohci_dump_intr_mask ("intrstatus", readl (&regs->intrstatus));
++ ohci_dump_intr_mask ("intrenable", readl (&regs->intrenable));
++
++ maybe_print_eds ("ed_periodcurrent", readl (&regs->ed_periodcurrent));
++
++ maybe_print_eds ("ed_controlhead", readl (&regs->ed_controlhead));
++ maybe_print_eds ("ed_controlcurrent", readl (&regs->ed_controlcurrent));
++
++ maybe_print_eds ("ed_bulkhead", readl (&regs->ed_bulkhead));
++ maybe_print_eds ("ed_bulkcurrent", readl (&regs->ed_bulkcurrent));
++
++ maybe_print_eds ("donehead", readl (&regs->donehead));
++}
++
++static void ohci_dump_roothub (ohci_t *controller, int verbose)
++{
++ __u32 temp, ndp, i;
++
++ temp = roothub_a (controller);
++ ndp = (temp & RH_A_NDP);
++
++ if (verbose) {
++ dbg ("roothub.a: %08x POTPGT=%d%s%s%s%s%s NDP=%d", temp,
++ ((temp & RH_A_POTPGT) >> 24) & 0xff,
++ (temp & RH_A_NOCP) ? " NOCP" : "",
++ (temp & RH_A_OCPM) ? " OCPM" : "",
++ (temp & RH_A_DT) ? " DT" : "",
++ (temp & RH_A_NPS) ? " NPS" : "",
++ (temp & RH_A_PSM) ? " PSM" : "",
++ ndp
++ );
++ temp = roothub_b (controller);
++ dbg ("roothub.b: %08x PPCM=%04x DR=%04x",
++ temp,
++ (temp & RH_B_PPCM) >> 16,
++ (temp & RH_B_DR)
++ );
++ temp = roothub_status (controller);
++ dbg ("roothub.status: %08x%s%s%s%s%s%s",
++ temp,
++ (temp & RH_HS_CRWE) ? " CRWE" : "",
++ (temp & RH_HS_OCIC) ? " OCIC" : "",
++ (temp & RH_HS_LPSC) ? " LPSC" : "",
++ (temp & RH_HS_DRWE) ? " DRWE" : "",
++ (temp & RH_HS_OCI) ? " OCI" : "",
++ (temp & RH_HS_LPS) ? " LPS" : ""
++ );
++ }
++
++ for (i = 0; i < ndp; i++) {
++ temp = roothub_portstatus (controller, i);
++ dbg ("roothub.portstatus [%d] = 0x%08x%s%s%s%s%s%s%s%s%s%s%s%s",
++ i,
++ temp,
++ (temp & RH_PS_PRSC) ? " PRSC" : "",
++ (temp & RH_PS_OCIC) ? " OCIC" : "",
++ (temp & RH_PS_PSSC) ? " PSSC" : "",
++ (temp & RH_PS_PESC) ? " PESC" : "",
++ (temp & RH_PS_CSC) ? " CSC" : "",
++
++ (temp & RH_PS_LSDA) ? " LSDA" : "",
++ (temp & RH_PS_PPS) ? " PPS" : "",
++ (temp & RH_PS_PRS) ? " PRS" : "",
++ (temp & RH_PS_POCI) ? " POCI" : "",
++ (temp & RH_PS_PSS) ? " PSS" : "",
++
++ (temp & RH_PS_PES) ? " PES" : "",
++ (temp & RH_PS_CCS) ? " CCS" : ""
++ );
++ }
++}
++
++static void ohci_dump (ohci_t *controller, int verbose)
++{
++ dbg ("OHCI controller usb-%s state", controller->slot_name);
++
++ /* dumps some of the state we know about */
++ ohci_dump_status (controller);
++ if (verbose)
++ ep_print_int_eds (controller, "hcca");
++ dbg ("hcca frame #%04x", controller->hcca->frame_no);
++ ohci_dump_roothub (controller, 1);
++}
++
++
++#endif /* DEBUG */
++
++/*-------------------------------------------------------------------------*
++ * Interface functions (URB)
++ *-------------------------------------------------------------------------*/
++
++/* get a transfer request */
++
++int sohci_submit_job(struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len, struct devrequest *setup, int interval)
++{
++ ohci_t *ohci;
++ ed_t * ed;
++ urb_priv_t *purb_priv;
++ int i, size = 0;
++
++ ohci = &gohci;
++
++ /* when controller's hung, permit only roothub cleanup attempts
++ * such as powering down ports */
++ if (ohci->disabled) {
++ err("sohci_submit_job: EPIPE");
++ return -1;
++ }
++
++ /* every endpoint has a ed, locate and fill it */
++ if (!(ed = ep_add_ed (dev, pipe))) {
++ err("sohci_submit_job: ENOMEM");
++ return -1;
++ }
++
++ /* for the private part of the URB we need the number of TDs (size) */
++ switch (usb_pipetype (pipe)) {
++ case PIPE_BULK: /* one TD for every 4096 Byte */
++ size = (transfer_len - 1) / 4096 + 1;
++ break;
++ case PIPE_CONTROL: /* 1 TD for setup, 1 for ACK and 1 for every 4096 B */
++ size = (transfer_len == 0)? 2:
++ (transfer_len - 1) / 4096 + 3;
++ break;
++ }
++
++ if (size >= (N_URB_TD - 1)) {
++ err("need %d TDs, only have %d", size, N_URB_TD);
++ return -1;
++ }
++ purb_priv = &urb_priv;
++ purb_priv->pipe = pipe;
++
++ /* fill the private part of the URB */
++ purb_priv->length = size;
++ purb_priv->ed = ed;
++ purb_priv->actual_length = 0;
++
++ /* allocate the TDs */
++ /* note that td[0] was allocated in ep_add_ed */
++ for (i = 0; i < size; i++) {
++ purb_priv->td[i] = td_alloc (dev);
++ if (!purb_priv->td[i]) {
++ purb_priv->length = i;
++ urb_free_priv (purb_priv);
++ err("sohci_submit_job: ENOMEM");
++ return -1;
++ }
++ }
++
++ if (ed->state == ED_NEW || (ed->state & ED_DEL)) {
++ urb_free_priv (purb_priv);
++ err("sohci_submit_job: EINVAL");
++ return -1;
++ }
++
++ /* link the ed into a chain if is not already */
++ if (ed->state != ED_OPER)
++ ep_link (ohci, ed);
++
++ /* fill the TDs and link it to the ed */
++ td_submit_job(dev, pipe, buffer, transfer_len, setup, purb_priv, interval);
++
++ return 0;
++}
++
++/*-------------------------------------------------------------------------*/
++
++#ifdef DEBUG
++/* tell us the current USB frame number */
++
++static int sohci_get_current_frame_number (struct usb_device *usb_dev)
++{
++ ohci_t *ohci = &gohci;
++
++ return m16_swap (ohci->hcca->frame_no);
++}
++#endif
++
++/*-------------------------------------------------------------------------*
++ * ED handling functions
++ *-------------------------------------------------------------------------*/
++
++/* link an ed into one of the HC chains */
++
++static int ep_link (ohci_t *ohci, ed_t *edi)
++{
++ volatile ed_t *ed = edi;
++
++ ed->state = ED_OPER;
++
++ switch (ed->type) {
++ case PIPE_CONTROL:
++ ed->hwNextED = 0;
++ if (ohci->ed_controltail == NULL) {
++ writel (ed, &ohci->regs->ed_controlhead);
++ } else {
++ ohci->ed_controltail->hwNextED = m32_swap (ed);
++ }
++ ed->ed_prev = ohci->ed_controltail;
++ if (!ohci->ed_controltail && !ohci->ed_rm_list[0] &&
++ !ohci->ed_rm_list[1] && !ohci->sleeping) {
++ ohci->hc_control |= OHCI_CTRL_CLE;
++ writel (ohci->hc_control, &ohci->regs->control);
++ }
++ ohci->ed_controltail = edi;
++ break;
++
++ case PIPE_BULK:
++ ed->hwNextED = 0;
++ if (ohci->ed_bulktail == NULL) {
++ writel (ed, &ohci->regs->ed_bulkhead);
++ } else {
++ ohci->ed_bulktail->hwNextED = m32_swap (ed);
++ }
++ ed->ed_prev = ohci->ed_bulktail;
++ if (!ohci->ed_bulktail && !ohci->ed_rm_list[0] &&
++ !ohci->ed_rm_list[1] && !ohci->sleeping) {
++ ohci->hc_control |= OHCI_CTRL_BLE;
++ writel (ohci->hc_control, &ohci->regs->control);
++ }
++ ohci->ed_bulktail = edi;
++ break;
++ }
++ return 0;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* unlink an ed from one of the HC chains.
++ * just the link to the ed is unlinked.
++ * the link from the ed still points to another operational ed or 0
++ * so the HC can eventually finish the processing of the unlinked ed */
++
++static int ep_unlink (ohci_t *ohci, ed_t *ed)
++{
++ ed->hwINFO |= m32_swap (OHCI_ED_SKIP);
++
++ switch (ed->type) {
++ case PIPE_CONTROL:
++ if (ed->ed_prev == NULL) {
++ if (!ed->hwNextED) {
++ ohci->hc_control &= ~OHCI_CTRL_CLE;
++ writel (ohci->hc_control, &ohci->regs->control);
++ }
++ writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_controlhead);
++ } else {
++ ed->ed_prev->hwNextED = ed->hwNextED;
++ }
++ if (ohci->ed_controltail == ed) {
++ ohci->ed_controltail = ed->ed_prev;
++ } else {
++ ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
++ }
++ break;
++
++ case PIPE_BULK:
++ if (ed->ed_prev == NULL) {
++ if (!ed->hwNextED) {
++ ohci->hc_control &= ~OHCI_CTRL_BLE;
++ writel (ohci->hc_control, &ohci->regs->control);
++ }
++ writel (m32_swap (*((__u32 *)&ed->hwNextED)), &ohci->regs->ed_bulkhead);
++ } else {
++ ed->ed_prev->hwNextED = ed->hwNextED;
++ }
++ if (ohci->ed_bulktail == ed) {
++ ohci->ed_bulktail = ed->ed_prev;
++ } else {
++ ((ed_t *)m32_swap (*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
++ }
++ break;
++ }
++ ed->state = ED_UNLINK;
++ return 0;
++}
++
++
++/*-------------------------------------------------------------------------*/
++
++/* add/reinit an endpoint; this should be done once at the usb_set_configuration command,
++ * but the USB stack is a little bit stateless so we do it at every transaction
++ * if the state of the ed is ED_NEW then a dummy td is added and the state is changed to ED_UNLINK
++ * in all other cases the state is left unchanged
++ * the ed info fields are setted anyway even though most of them should not change */
++
++static ed_t * ep_add_ed (struct usb_device *usb_dev, unsigned long pipe)
++{
++ td_t *td;
++ ed_t *ed_ret;
++ volatile ed_t *ed;
++
++ ed = ed_ret = &ohci_dev.ed[(usb_pipeendpoint (pipe) << 1) |
++ (usb_pipecontrol (pipe)? 0: usb_pipeout (pipe))];
++
++ if ((ed->state & ED_DEL) || (ed->state & ED_URB_DEL)) {
++ err("ep_add_ed: pending delete");
++ /* pending delete request */
++ return NULL;
++ }
++
++ if (ed->state == ED_NEW) {
++ ed->hwINFO = m32_swap (OHCI_ED_SKIP); /* skip ed */
++ /* dummy td; end of td list for ed */
++ td = td_alloc (usb_dev);
++ ed->hwTailP = m32_swap (td);
++ ed->hwHeadP = ed->hwTailP;
++ ed->state = ED_UNLINK;
++ ed->type = usb_pipetype (pipe);
++ ohci_dev.ed_cnt++;
++ }
++
++ ed->hwINFO = m32_swap (usb_pipedevice (pipe)
++ | usb_pipeendpoint (pipe) << 7
++ | (usb_pipeisoc (pipe)? 0x8000: 0)
++ | (usb_pipecontrol (pipe)? 0: (usb_pipeout (pipe)? 0x800: 0x1000))
++ | usb_pipeslow (pipe) << 13
++ | usb_maxpacket (usb_dev, pipe) << 16);
++
++ return ed_ret;
++}
++
++/*-------------------------------------------------------------------------*
++ * TD handling functions
++ *-------------------------------------------------------------------------*/
++
++/* enqueue next TD for this URB (OHCI spec 5.2.8.2) */
++
++static void td_fill (ohci_t *ohci, unsigned int info,
++ void *data, int len,
++ struct usb_device *dev, int index, urb_priv_t *urb_priv)
++{
++ volatile td_t *td, *td_pt;
++#ifdef OHCI_FILL_TRACE
++ int i;
++#endif
++
++ if (index > urb_priv->length) {
++ err("index > length");
++ return;
++ }
++ /* use this td as the next dummy */
++ td_pt = urb_priv->td [index];
++ td_pt->hwNextTD = 0;
++
++ /* fill the old dummy TD */
++ td = urb_priv->td [index] = (td_t *)(m32_swap (urb_priv->ed->hwTailP) & ~0xf);
++
++ td->ed = urb_priv->ed;
++ td->next_dl_td = NULL;
++ td->index = index;
++ td->data = (__u32)data;
++#ifdef OHCI_FILL_TRACE
++ if ((usb_pipetype(urb_priv->pipe) == PIPE_BULK) && usb_pipeout(urb_priv->pipe)) {
++ for (i = 0; i < len; i++)
++ printf("td->data[%d] %#2x ",i, ((unsigned char *)td->data)[i]);
++ printf("\n");
++ }
++#endif
++ if (!len)
++ data = 0;
++
++ td->hwINFO = m32_swap (info);
++ td->hwCBP = m32_swap (data);
++ if (data)
++ td->hwBE = m32_swap (data + len - 1);
++ else
++ td->hwBE = 0;
++ td->hwNextTD = m32_swap (td_pt);
++ td->hwPSW [0] = m16_swap (((__u32)data & 0x0FFF) | 0xE000);
++
++ /* append to queue */
++ td->ed->hwTailP = td->hwNextTD;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* prepare all TDs of a transfer */
++
++static void td_submit_job (struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len, struct devrequest *setup, urb_priv_t *urb, int interval)
++{
++ ohci_t *ohci = &gohci;
++ int data_len = transfer_len;
++ void *data;
++ int cnt = 0;
++ __u32 info = 0;
++ unsigned int toggle = 0;
++
++ /* OHCI handles the DATA-toggles itself, we just use the USB-toggle bits for reseting */
++ if(usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe))) {
++ toggle = TD_T_TOGGLE;
++ } else {
++ toggle = TD_T_DATA0;
++ usb_settoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe), 1);
++ }
++ urb->td_cnt = 0;
++ if (data_len)
++ data = buffer;
++ else
++ data = 0;
++
++ switch (usb_pipetype (pipe)) {
++ case PIPE_BULK:
++ info = usb_pipeout (pipe)?
++ TD_CC | TD_DP_OUT : TD_CC | TD_DP_IN ;
++ while(data_len > 4096) {
++ td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, 4096, dev, cnt, urb);
++ data += 4096; data_len -= 4096; cnt++;
++ }
++ info = usb_pipeout (pipe)?
++ TD_CC | TD_DP_OUT : TD_CC | TD_R | TD_DP_IN ;
++ td_fill (ohci, info | (cnt? TD_T_TOGGLE:toggle), data, data_len, dev, cnt, urb);
++ cnt++;
++
++ if (!ohci->sleeping)
++ writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */
++ break;
++
++ case PIPE_CONTROL:
++ info = TD_CC | TD_DP_SETUP | TD_T_DATA0;
++ td_fill (ohci, info, setup, 8, dev, cnt++, urb);
++ if (data_len > 0) {
++ info = usb_pipeout (pipe)?
++ TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1 : TD_CC | TD_R | TD_DP_IN | TD_T_DATA1;
++ /* NOTE: mishandles transfers >8K, some >4K */
++ td_fill (ohci, info, data, data_len, dev, cnt++, urb);
++ }
++ info = usb_pipeout (pipe)?
++ TD_CC | TD_DP_IN | TD_T_DATA1: TD_CC | TD_DP_OUT | TD_T_DATA1;
++ td_fill (ohci, info, data, 0, dev, cnt++, urb);
++ if (!ohci->sleeping)
++ writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */
++ break;
++ }
++ if (urb->length != cnt)
++ dbg("TD LENGTH %d != CNT %d", urb->length, cnt);
++}
++
++/*-------------------------------------------------------------------------*
++ * Done List handling functions
++ *-------------------------------------------------------------------------*/
++
++
++/* calculate the transfer length and update the urb */
++
++static void dl_transfer_length(td_t * td)
++{
++ __u32 tdINFO, tdBE, tdCBP;
++ urb_priv_t *lurb_priv = &urb_priv;
++
++ tdINFO = m32_swap (td->hwINFO);
++ tdBE = m32_swap (td->hwBE);
++ tdCBP = m32_swap (td->hwCBP);
++
++
++ if (!(usb_pipetype (lurb_priv->pipe) == PIPE_CONTROL &&
++ ((td->index == 0) || (td->index == lurb_priv->length - 1)))) {
++ if (tdBE != 0) {
++ if (td->hwCBP == 0)
++ lurb_priv->actual_length += tdBE - td->data + 1;
++ else
++ lurb_priv->actual_length += tdCBP - td->data;
++ }
++ }
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* replies to the request have to be on a FIFO basis so
++ * we reverse the reversed done-list */
++
++static td_t * dl_reverse_done_list (ohci_t *ohci)
++{
++ __u32 td_list_hc;
++ td_t *td_rev = NULL;
++ td_t *td_list = NULL;
++ urb_priv_t *lurb_priv = NULL;
++
++ td_list_hc = m32_swap (ohci->hcca->done_head) & 0xfffffff0;
++ ohci->hcca->done_head = 0;
++
++ while (td_list_hc) {
++ td_list = (td_t *)td_list_hc;
++
++ if (TD_CC_GET (m32_swap (td_list->hwINFO))) {
++ lurb_priv = &urb_priv;
++ dbg(" USB-error/status: %x : %p",
++ TD_CC_GET (m32_swap (td_list->hwINFO)), td_list);
++ if (td_list->ed->hwHeadP & m32_swap (0x1)) {
++ if (lurb_priv && ((td_list->index + 1) < lurb_priv->length)) {
++ td_list->ed->hwHeadP =
++ (lurb_priv->td[lurb_priv->length - 1]->hwNextTD & m32_swap (0xfffffff0)) |
++ (td_list->ed->hwHeadP & m32_swap (0x2));
++ lurb_priv->td_cnt += lurb_priv->length - td_list->index - 1;
++ } else
++ td_list->ed->hwHeadP &= m32_swap (0xfffffff2);
++ }
++ }
++
++ td_list->next_dl_td = td_rev;
++ td_rev = td_list;
++ td_list_hc = m32_swap (td_list->hwNextTD) & 0xfffffff0;
++ }
++ return td_list;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* td done list */
++static int dl_done_list (ohci_t *ohci, td_t *td_list)
++{
++ td_t *td_list_next = NULL;
++ ed_t *ed;
++ int cc = 0;
++ int stat = 0;
++ /* urb_t *urb; */
++ urb_priv_t *lurb_priv;
++ __u32 tdINFO, edHeadP, edTailP;
++
++ while (td_list) {
++ td_list_next = td_list->next_dl_td;
++
++ lurb_priv = &urb_priv;
++ tdINFO = m32_swap (td_list->hwINFO);
++
++ ed = td_list->ed;
++
++ dl_transfer_length(td_list);
++
++ /* error code of transfer */
++ cc = TD_CC_GET (tdINFO);
++ if (cc != 0) {
++ dbg("ConditionCode %#x", cc);
++ stat = cc_to_error[cc];
++ }
++
++ if (ed->state != ED_NEW) {
++ edHeadP = m32_swap (ed->hwHeadP) & 0xfffffff0;
++ edTailP = m32_swap (ed->hwTailP);
++
++ /* unlink eds if they are not busy */
++ if ((edHeadP == edTailP) && (ed->state == ED_OPER))
++ ep_unlink (ohci, ed);
++ }
++
++ td_list = td_list_next;
++ }
++ return stat;
++}
++
++/*-------------------------------------------------------------------------*
++ * Virtual Root Hub
++ *-------------------------------------------------------------------------*/
++
++/* Device descriptor */
++static __u8 root_hub_dev_des[] =
++{
++ 0x12, /* __u8 bLength; */
++ 0x01, /* __u8 bDescriptorType; Device */
++ 0x10, /* __u16 bcdUSB; v1.1 */
++ 0x01,
++ 0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */
++ 0x00, /* __u8 bDeviceSubClass; */
++ 0x00, /* __u8 bDeviceProtocol; */
++ 0x08, /* __u8 bMaxPacketSize0; 8 Bytes */
++ 0x00, /* __u16 idVendor; */
++ 0x00,
++ 0x00, /* __u16 idProduct; */
++ 0x00,
++ 0x00, /* __u16 bcdDevice; */
++ 0x00,
++ 0x00, /* __u8 iManufacturer; */
++ 0x01, /* __u8 iProduct; */
++ 0x00, /* __u8 iSerialNumber; */
++ 0x01 /* __u8 bNumConfigurations; */
++};
++
++
++/* Configuration descriptor */
++static __u8 root_hub_config_des[] =
++{
++ 0x09, /* __u8 bLength; */
++ 0x02, /* __u8 bDescriptorType; Configuration */
++ 0x19, /* __u16 wTotalLength; */
++ 0x00,
++ 0x01, /* __u8 bNumInterfaces; */
++ 0x01, /* __u8 bConfigurationValue; */
++ 0x00, /* __u8 iConfiguration; */
++ 0x40, /* __u8 bmAttributes;
++ Bit 7: Bus-powered, 6: Self-powered, 5 Remote-wakwup, 4..0: resvd */
++ 0x00, /* __u8 MaxPower; */
++
++ /* interface */
++ 0x09, /* __u8 if_bLength; */
++ 0x04, /* __u8 if_bDescriptorType; Interface */
++ 0x00, /* __u8 if_bInterfaceNumber; */
++ 0x00, /* __u8 if_bAlternateSetting; */
++ 0x01, /* __u8 if_bNumEndpoints; */
++ 0x09, /* __u8 if_bInterfaceClass; HUB_CLASSCODE */
++ 0x00, /* __u8 if_bInterfaceSubClass; */
++ 0x00, /* __u8 if_bInterfaceProtocol; */
++ 0x00, /* __u8 if_iInterface; */
++
++ /* endpoint */
++ 0x07, /* __u8 ep_bLength; */
++ 0x05, /* __u8 ep_bDescriptorType; Endpoint */
++ 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */
++ 0x03, /* __u8 ep_bmAttributes; Interrupt */
++ 0x02, /* __u16 ep_wMaxPacketSize; ((MAX_ROOT_PORTS + 1) / 8 */
++ 0x00,
++ 0xff /* __u8 ep_bInterval; 255 ms */
++};
++
++static unsigned char root_hub_str_index0[] =
++{
++ 0x04, /* __u8 bLength; */
++ 0x03, /* __u8 bDescriptorType; String-descriptor */
++ 0x09, /* __u8 lang ID */
++ 0x04, /* __u8 lang ID */
++};
++
++static unsigned char root_hub_str_index1[] =
++{
++ 28, /* __u8 bLength; */
++ 0x03, /* __u8 bDescriptorType; String-descriptor */
++ 'O', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'H', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'C', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'I', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ ' ', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'R', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'o', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'o', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 't', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ ' ', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'H', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'u', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++ 'b', /* __u8 Unicode */
++ 0, /* __u8 Unicode */
++};
++
++/* Hub class-specific descriptor is constructed dynamically */
++
++
++/*-------------------------------------------------------------------------*/
++
++#define OK(x) len = (x); break
++#ifdef DEBUG
++#define WR_RH_STAT(x) {info("WR:status %#8x", (x));writel((x), &gohci.regs->roothub.status);}
++#define WR_RH_PORTSTAT(x) {info("WR:portstatus[%d] %#8x", wIndex-1, (x));writel((x), &gohci.regs->roothub.portstatus[wIndex-1]);}
++#else
++#define WR_RH_STAT(x) writel((x), &gohci.regs->roothub.status)
++#define WR_RH_PORTSTAT(x) writel((x), &gohci.regs->roothub.portstatus[wIndex-1])
++#endif
++#define RD_RH_STAT roothub_status(&gohci)
++#define RD_RH_PORTSTAT roothub_portstatus(&gohci,wIndex-1)
++
++/* request to virtual root hub */
++
++int rh_check_port_status(ohci_t *controller)
++{
++ __u32 temp, ndp, i;
++ int res;
++
++ res = -1;
++ temp = roothub_a (controller);
++ ndp = (temp & RH_A_NDP);
++ for (i = 0; i < ndp; i++) {
++ temp = roothub_portstatus (controller, i);
++ /* check for a device disconnect */
++ if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
++ (RH_PS_PESC | RH_PS_CSC)) &&
++ ((temp & RH_PS_CCS) == 0)) {
++ res = i;
++ break;
++ }
++ }
++ return res;
++}
++
++static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
++ void *buffer, int transfer_len, struct devrequest *cmd)
++{
++ void * data = buffer;
++ int leni = transfer_len;
++ int len = 0;
++ int stat = 0;
++ __u32 datab[4];
++ __u8 *data_buf = (__u8 *)datab;
++ __u16 bmRType_bReq;
++ __u16 wValue;
++ __u16 wIndex;
++ __u16 wLength;
++
++#ifdef DEBUG
++urb_priv.actual_length = 0;
++pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
++#else
++ wait_ms(1);
++#endif
++ if ((pipe & PIPE_INTERRUPT) == PIPE_INTERRUPT) {
++ info("Root-Hub submit IRQ: NOT implemented");
++ return 0;
++ }
++
++ bmRType_bReq = cmd->requesttype | (cmd->request << 8);
++ wValue = m16_swap (cmd->value);
++ wIndex = m16_swap (cmd->index);
++ wLength = m16_swap (cmd->length);
++
++ info("Root-Hub: adr: %2x cmd(%1x): %08x %04x %04x %04x",
++ dev->devnum, 8, bmRType_bReq, wValue, wIndex, wLength);
++
++ switch (bmRType_bReq) {
++ /* Request Destination:
++ without flags: Device,
++ RH_INTERFACE: interface,
++ RH_ENDPOINT: endpoint,
++ RH_CLASS means HUB here,
++ RH_OTHER | RH_CLASS almost ever means HUB_PORT here
++ */
++
++ case RH_GET_STATUS:
++ *(__u16 *) data_buf = m16_swap (1); OK (2);
++ case RH_GET_STATUS | RH_INTERFACE:
++ *(__u16 *) data_buf = m16_swap (0); OK (2);
++ case RH_GET_STATUS | RH_ENDPOINT:
++ *(__u16 *) data_buf = m16_swap (0); OK (2);
++ case RH_GET_STATUS | RH_CLASS:
++ *(__u32 *) data_buf = m32_swap (
++ RD_RH_STAT & ~(RH_HS_CRWE | RH_HS_DRWE));
++ OK (4);
++ case RH_GET_STATUS | RH_OTHER | RH_CLASS:
++ *(__u32 *) data_buf = m32_swap (RD_RH_PORTSTAT); OK (4);
++
++ case RH_CLEAR_FEATURE | RH_ENDPOINT:
++ switch (wValue) {
++ case (RH_ENDPOINT_STALL): OK (0);
++ }
++ break;
++
++ case RH_CLEAR_FEATURE | RH_CLASS:
++ switch (wValue) {
++ case RH_C_HUB_LOCAL_POWER:
++ OK(0);
++ case (RH_C_HUB_OVER_CURRENT):
++ WR_RH_STAT(RH_HS_OCIC); OK (0);
++ }
++ break;
++
++ case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
++ switch (wValue) {
++ case (RH_PORT_ENABLE):
++ WR_RH_PORTSTAT (RH_PS_CCS ); OK (0);
++ case (RH_PORT_SUSPEND):
++ WR_RH_PORTSTAT (RH_PS_POCI); OK (0);
++ case (RH_PORT_POWER):
++ WR_RH_PORTSTAT (RH_PS_LSDA); OK (0);
++ case (RH_C_PORT_CONNECTION):
++ WR_RH_PORTSTAT (RH_PS_CSC ); OK (0);
++ case (RH_C_PORT_ENABLE):
++ WR_RH_PORTSTAT (RH_PS_PESC); OK (0);
++ case (RH_C_PORT_SUSPEND):
++ WR_RH_PORTSTAT (RH_PS_PSSC); OK (0);
++ case (RH_C_PORT_OVER_CURRENT):
++ WR_RH_PORTSTAT (RH_PS_OCIC); OK (0);
++ case (RH_C_PORT_RESET):
++ WR_RH_PORTSTAT (RH_PS_PRSC); OK (0);
++ }
++ break;
++
++ case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
++ switch (wValue) {
++ case (RH_PORT_SUSPEND):
++ WR_RH_PORTSTAT (RH_PS_PSS ); OK (0);
++ case (RH_PORT_RESET): /* BUG IN HUP CODE *********/
++ if (RD_RH_PORTSTAT & RH_PS_CCS)
++ WR_RH_PORTSTAT (RH_PS_PRS);
++ OK (0);
++ case (RH_PORT_POWER):
++ WR_RH_PORTSTAT (RH_PS_PPS ); OK (0);
++ case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
++ if (RD_RH_PORTSTAT & RH_PS_CCS)
++ WR_RH_PORTSTAT (RH_PS_PES );
++ OK (0);
++ }
++ break;
++
++ case RH_SET_ADDRESS: gohci.rh.devnum = wValue; OK(0);
++
++ case RH_GET_DESCRIPTOR:
++ switch ((wValue & 0xff00) >> 8) {
++ case (0x01): /* device descriptor */
++ len = min_t(unsigned int,
++ leni,
++ min_t(unsigned int,
++ sizeof (root_hub_dev_des),
++ wLength));
++ data_buf = root_hub_dev_des; OK(len);
++ case (0x02): /* configuration descriptor */
++ len = min_t(unsigned int,
++ leni,
++ min_t(unsigned int,
++ sizeof (root_hub_config_des),
++ wLength));
++ data_buf = root_hub_config_des; OK(len);
++ case (0x03): /* string descriptors */
++ if(wValue==0x0300) {
++ len = min_t(unsigned int,
++ leni,
++ min_t(unsigned int,
++ sizeof (root_hub_str_index0),
++ wLength));
++ data_buf = root_hub_str_index0;
++ OK(len);
++ }
++ if(wValue==0x0301) {
++ len = min_t(unsigned int,
++ leni,
++ min_t(unsigned int,
++ sizeof (root_hub_str_index1),
++ wLength));
++ data_buf = root_hub_str_index1;
++ OK(len);
++ }
++ default:
++ stat = USB_ST_STALLED;
++ }
++ break;
++
++ case RH_GET_DESCRIPTOR | RH_CLASS:
++ {
++ __u32 temp = roothub_a (&gohci);
++
++ data_buf [0] = 9; /* min length; */
++ data_buf [1] = 0x29;
++ data_buf [2] = temp & RH_A_NDP;
++ data_buf [3] = 0;
++ if (temp & RH_A_PSM) /* per-port power switching? */
++ data_buf [3] |= 0x1;
++ if (temp & RH_A_NOCP) /* no overcurrent reporting? */
++ data_buf [3] |= 0x10;
++ else if (temp & RH_A_OCPM) /* per-port overcurrent reporting? */
++ data_buf [3] |= 0x8;
++
++ /* corresponds to data_buf[4-7] */
++ datab [1] = 0;
++ data_buf [5] = (temp & RH_A_POTPGT) >> 24;
++ temp = roothub_b (&gohci);
++ data_buf [7] = temp & RH_B_DR;
++ if (data_buf [2] < 7) {
++ data_buf [8] = 0xff;
++ } else {
++ data_buf [0] += 2;
++ data_buf [8] = (temp & RH_B_DR) >> 8;
++ data_buf [10] = data_buf [9] = 0xff;
++ }
++
++ len = min_t(unsigned int, leni,
++ min_t(unsigned int, data_buf [0], wLength));
++ OK (len);
++ }
++
++ case RH_GET_CONFIGURATION: *(__u8 *) data_buf = 0x01; OK (1);
++
++ case RH_SET_CONFIGURATION: WR_RH_STAT (0x10000); OK (0);
++
++ default:
++ dbg ("unsupported root hub command");
++ stat = USB_ST_STALLED;
++ }
++
++#ifdef DEBUG
++ ohci_dump_roothub (&gohci, 1);
++#else
++ wait_ms(1);
++#endif
++
++ len = min_t(int, len, leni);
++ if (data != data_buf)
++ memcpy (data, data_buf, len);
++ dev->act_len = len;
++ dev->status = stat;
++
++#ifdef DEBUG
++ if (transfer_len)
++ urb_priv.actual_length = transfer_len;
++ pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
++#else
++ wait_ms(1);
++#endif
++
++ return stat;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* common code for handling submit messages - used for all but root hub */
++/* accesses. */
++int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len, struct devrequest *setup, int interval)
++{
++ int stat = 0;
++ int maxsize = usb_maxpacket(dev, pipe);
++ int timeout;
++
++ /* device pulled? Shortcut the action. */
++ if (devgone == dev) {
++ dev->status = USB_ST_CRC_ERR;
++ return 0;
++ }
++
++#ifdef DEBUG
++ urb_priv.actual_length = 0;
++ pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
++#else
++ wait_ms(1);
++#endif
++ if (!maxsize) {
++ err("submit_common_message: pipesize for pipe %lx is zero",
++ pipe);
++ return -1;
++ }
++
++ if (sohci_submit_job(dev, pipe, buffer, transfer_len, setup, interval) < 0) {
++ err("sohci_submit_job failed");
++ return -1;
++ }
++
++ wait_ms(10);
++ /* ohci_dump_status(&gohci); */
++
++ /* allow more time for a BULK device to react - some are slow */
++#define BULK_TO 5000 /* timeout in milliseconds */
++ if (usb_pipetype (pipe) == PIPE_BULK)
++ timeout = BULK_TO;
++ else
++ timeout = 100;
++
++ /* wait for it to complete */
++ for (;;) {
++ /* check whether the controller is done */
++ stat = hc_interrupt();
++ if (stat < 0) {
++ stat = USB_ST_CRC_ERR;
++ break;
++ }
++ if (stat >= 0 && stat != 0xff) {
++ /* 0xff is returned for an SF-interrupt */
++ break;
++ }
++ if (--timeout) {
++ wait_ms(1);
++ } else {
++ err("CTL:TIMEOUT ");
++ stat = USB_ST_CRC_ERR;
++ break;
++ }
++ }
++ /* we got an Root Hub Status Change interrupt */
++ if (got_rhsc) {
++#ifdef DEBUG
++ ohci_dump_roothub (&gohci, 1);
++#endif
++ got_rhsc = 0;
++ /* abuse timeout */
++ timeout = rh_check_port_status(&gohci);
++ if (timeout >= 0) {
++#if 0 /* this does nothing useful, but leave it here in case that changes */
++ /* the called routine adds 1 to the passed value */
++ usb_hub_port_connect_change(gohci.rh.dev, timeout - 1);
++#endif
++ /*
++ * XXX
++ * This is potentially dangerous because it assumes
++ * that only one device is ever plugged in!
++ */
++ devgone = dev;
++ }
++ }
++
++ dev->status = stat;
++ dev->act_len = transfer_len;
++
++#ifdef DEBUG
++ pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe));
++#else
++ wait_ms(1);
++#endif
++
++ /* free TDs in urb_priv */
++ urb_free_priv (&urb_priv);
++ return 0;
++}
++
++/* submit routines called from usb.c */
++int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len)
++{
++ info("submit_bulk_msg");
++ return submit_common_msg(dev, pipe, buffer, transfer_len, NULL, 0);
++}
++
++int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len, struct devrequest *setup)
++{
++ int maxsize = usb_maxpacket(dev, pipe);
++
++ info("submit_control_msg");
++#ifdef DEBUG
++ urb_priv.actual_length = 0;
++ pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
++#else
++ wait_ms(1);
++#endif
++ if (!maxsize) {
++ err("submit_control_message: pipesize for pipe %lx is zero",
++ pipe);
++ return -1;
++ }
++ if (((pipe >> 8) & 0x7f) == gohci.rh.devnum) {
++ gohci.rh.dev = dev;
++ /* root hub - redirect */
++ return ohci_submit_rh_msg(dev, pipe, buffer, transfer_len,
++ setup);
++ }
++
++ return submit_common_msg(dev, pipe, buffer, transfer_len, setup, 0);
++}
++
++int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
++ int transfer_len, int interval)
++{
++ info("submit_int_msg");
++ return -1;
++}
++
++/*-------------------------------------------------------------------------*
++ * HC functions
++ *-------------------------------------------------------------------------*/
++
++/* reset the HC and BUS */
++
++static int hc_reset (ohci_t *ohci)
++{
++ int timeout = 30;
++ int smm_timeout = 50; /* 0,5 sec */
++
++ if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */
++ writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
++ info("USB HC TakeOver from SMM");
++ while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
++ wait_ms (10);
++ if (--smm_timeout == 0) {
++ err("USB HC TakeOver failed!");
++ return -1;
++ }
++ }
++ }
++
++ /* Disable HC interrupts */
++ writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
++
++ dbg("USB HC reset_hc usb-%s: ctrl = 0x%X ;",
++ ohci->slot_name,
++ readl (&ohci->regs->control));
++
++ /* Reset USB (needed by some controllers) */
++ writel (0, &ohci->regs->control);
++
++ /* HC Reset requires max 10 us delay */
++ writel (OHCI_HCR, &ohci->regs->cmdstatus);
++ while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
++ if (--timeout == 0) {
++ err("USB HC reset timed out!");
++ return -1;
++ }
++ udelay (1);
++ }
++ return 0;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* Start an OHCI controller, set the BUS operational
++ * enable interrupts
++ * connect the virtual root hub */
++
++static int hc_start (ohci_t * ohci)
++{
++ __u32 mask;
++ unsigned int fminterval;
++
++ ohci->disabled = 1;
++
++ /* Tell the controller where the control and bulk lists are
++ * The lists are empty now. */
++
++ writel (0, &ohci->regs->ed_controlhead);
++ writel (0, &ohci->regs->ed_bulkhead);
++
++ writel ((__u32)ohci->hcca, &ohci->regs->hcca); /* a reset clears this */
++
++ fminterval = 0x2edf;
++ writel ((fminterval * 9) / 10, &ohci->regs->periodicstart);
++ fminterval |= ((((fminterval - 210) * 6) / 7) << 16);
++ writel (fminterval, &ohci->regs->fminterval);
++ writel (0x628, &ohci->regs->lsthresh);
++
++ /* start controller operations */
++ ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER;
++ ohci->disabled = 0;
++ writel (ohci->hc_control, &ohci->regs->control);
++
++ /* disable all interrupts */
++ mask = (OHCI_INTR_SO | OHCI_INTR_WDH | OHCI_INTR_SF | OHCI_INTR_RD |
++ OHCI_INTR_UE | OHCI_INTR_FNO | OHCI_INTR_RHSC |
++ OHCI_INTR_OC | OHCI_INTR_MIE);
++ writel (mask, &ohci->regs->intrdisable);
++ /* clear all interrupts */
++ mask &= ~OHCI_INTR_MIE;
++ writel (mask, &ohci->regs->intrstatus);
++ /* Choose the interrupts we care about now - but w/o MIE */
++ mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
++ writel (mask, &ohci->regs->intrenable);
++
++#ifdef OHCI_USE_NPS
++ /* required for AMD-756 and some Mac platforms */
++ writel ((roothub_a (ohci) | RH_A_NPS) & ~RH_A_PSM,
++ &ohci->regs->roothub.a);
++ writel (RH_HS_LPSC, &ohci->regs->roothub.status);
++#endif /* OHCI_USE_NPS */
++
++#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);})
++ /* POTPGT delay is bits 24-31, in 2 ms units. */
++ mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
++
++ /* connect the virtual root hub */
++ ohci->rh.devnum = 0;
++
++printf( "---> Done with hc_start\n" );
++
++ return 0;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/* an interrupt happens */
++
++static int
++hc_interrupt (void)
++{
++ ohci_t *ohci = &gohci;
++ struct ohci_regs *regs = ohci->regs;
++ int ints;
++ int stat = -1;
++
++ if ((ohci->hcca->done_head != 0) && !(m32_swap (ohci->hcca->done_head) & 0x01)) {
++ ints = OHCI_INTR_WDH;
++ } else {
++ ints = readl (&regs->intrstatus);
++ }
++
++dbg("Interrupt: %x frame: %x", ints, ohci->hcca->frame_no);
++
++ if (ints & OHCI_INTR_RHSC) {
++dbg("rhsc\n" );
++ got_rhsc = 1;
++ }
++
++ if (ints & OHCI_INTR_UE) {
++ ohci->disabled++;
++ err ("OHCI Unrecoverable Error, controller usb-%s disabled",
++ ohci->slot_name);
++ /* e.g. due to PCI Master/Target Abort */
++
++#ifdef DEBUG
++ ohci_dump (ohci, 1);
++#else
++ wait_ms(1);
++#endif
++ /* FIXME: be optimistic, hope that bug won't repeat often. */
++ /* Make some non-interrupt context restart the controller. */
++ /* Count and limit the retries though; either hardware or */
++ /* software errors can go forever... */
++ hc_reset (ohci);
++ return -1;
++ }
++
++ if (ints & OHCI_INTR_WDH) {
++ wait_ms(1);
++ writel (OHCI_INTR_WDH, &regs->intrdisable);
++ stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
++ writel (OHCI_INTR_WDH, &regs->intrenable);
++dbg("wdh: %x\n", stat );
++ goto out ;
++ }
++
++ if (ints & OHCI_INTR_SO) {
++ dbg("USB Schedule overrun\n");
++ writel (OHCI_INTR_SO, &regs->intrenable);
++ stat = -1;
++ }
++
++ /* FIXME: this assumes SOF (1/ms) interrupts don't get lost... */
++ if (ints & OHCI_INTR_SF) {
++ unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1;
++ wait_ms(1);
++ writel (OHCI_INTR_SF, &regs->intrdisable);
++ if (ohci->ed_rm_list[frame] != NULL)
++ writel (OHCI_INTR_SF, &regs->intrenable);
++ if( -1 == stat )
++ stat = 0xff;
++dbg("sf\n" );
++ }
++ if( 0 == ints )
++ stat = 0 ;
++out:
++ writel (ints, &regs->intrstatus);
++ return stat;
++}
++
++/*-------------------------------------------------------------------------*/
++
++/*-------------------------------------------------------------------------*/
++
++/* De-allocate all resources.. */
++
++static void hc_release_ohci (ohci_t *ohci)
++{
++ dbg ("USB HC release ohci usb-%s", ohci->slot_name);
++
++ if (!ohci->disabled)
++ hc_reset (ohci);
++}
++
++/*-------------------------------------------------------------------------*/
++
++/*
++ * low level initalisation routine, called from usb.c
++ */
++static char ohci_inited = 0;
++
++int usb_lowlevel_init(void)
++{
++#ifdef FIXME
++ S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
++ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
++ /*
++ * Set the 48 MHz UPLL clocking. Values are taken from
++ * "PLL value selection guide", 6-23, s3c2400_UM.pdf.
++ */
++ clk_power->UPLLCON = ((40 << 12) + (1 << 4) + 2);
++ gpio->MISCCR |= 0x8; /* 1 = use pads related USB for USB host */
++ /*
++ * Enable USB host clock.
++ */
++ clk_power->CLKCON |= (1 << 4);
++#endif
++#ifdef CONFIG_PXA27X
++ /*
++ * Section 20.6.1 of PXA Developer's reference manual
++ */
++ GPCR3 |= 0x80 ; // GP103 low
++
++ UHCHR |= UHCHR_SSEP2|UHCHR_SSEP1 ; // Port 2 and 3 not supported
++ UHCHR &= ~(UHCHR_SSE|UHCHR_SSEP0);
++
++// UHCRHS &= ~UHCRHS_LPS ;
++// UHCCOMS &= ~UHCCOMS_HCR ; // reset
++ CKEN |= CKEN10_USBHOST ;
++ udelay(10);
++ UHCHR &= ~(UHCHR_FHR|UHCHR_SSE);
++#elif defined( CONFIG_SM501 )
++ USB_GATE_MODE0 |= ENABLE_USBH ;
++ USB_GATE_MODE1 |= ENABLE_USBH ;
++#endif
++
++ memset (&gohci, 0, sizeof (ohci_t));
++ memset (&urb_priv, 0, sizeof (urb_priv_t));
++
++ /* align the storage */
++ if ((__u32)&ghcca[0] & 0xff) {
++ err("HCCA not aligned!!");
++ return -1;
++ }
++ phcca = &ghcca[0];
++ info("aligned ghcca %p", phcca);
++ memset(&ohci_dev, 0, sizeof(struct ohci_device));
++ if ((__u32)&ohci_dev.ed[0] & 0x7) {
++ err("EDs not aligned!!");
++ return -1;
++ }
++ memset(gtd, 0, sizeof(td_t) * (NUM_TD + 1));
++ if ((__u32)gtd & 0x7) {
++ err("TDs not aligned!!");
++ return -1;
++ }
++ ptd = gtd;
++ gohci.hcca = phcca;
++ memset (phcca, 0, sizeof (struct ohci_hcca));
++
++ gohci.disabled = 1;
++ gohci.sleeping = 0;
++ gohci.irq = -1;
++ gohci.regs = (struct ohci_regs *)USBH_BASE ;
++ gohci.flags = 0;
++ gohci.slot_name = "s3c2400";
++
++ if (hc_reset (&gohci) < 0) {
++ err( "----> Error from hc_reset\n" );
++ hc_release_ohci (&gohci);
++ /* Initialization failed */
++#ifdef FIXME
++ clk_power->CLKCON &= ~(1 << 4);
++#endif
++#ifdef CONFIG_PXA27X
++ CKEN &= ~CKEN10_USBHOST ;
++#elif defined( CONFIG_SM501 )
++#endif
++ return -1;
++ }
++
++ /* FIXME this is a second HC reset; why?? */
++ writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
++ wait_ms (10);
++
++ if (hc_start (&gohci) < 0) {
++ err ("can't start usb-%s", gohci.slot_name);
++ hc_release_ohci (&gohci);
++ /* Initialization failed */
++#ifdef FIXME
++ clk_power->CLKCON &= ~(1 << 4);
++#endif
++#ifdef CONFIG_PXA27X
++ CKEN &= ~CKEN10_USBHOST ;
++#elif defined( CONFIG_SM501 )
++#endif
++ return -1;
++ }
++
++#ifdef DEBUG
++ ohci_dump (&gohci, 1);
++#else
++ wait_ms(1);
++#endif
++printf( "----> end of low_level_init()\n" );
++ ohci_inited = 1;
++ return 0;
++}
++
++int usb_lowlevel_stop(void)
++{
++ /* this gets called really early - before the controller has */
++ /* even been initialized! */
++ if (!ohci_inited)
++ return 0;
++ /* TODO release any interrupts, etc. */
++ /* call hc_release_ohci() here ? */
++ hc_reset (&gohci);
++
++#ifdef CONFIG_PXA27X
++ /*
++ * Section 20.7.4.4 of PXA Developer's reference manual
++ */
++ UHCCOMS |= UHCCOMS_HCR ; // reset
++ udelay(10);
++ UHCRHS |= UHCRHS_LPS ;
++ UHCHR |= UHCHR_SSE ;
++ CKEN &= ~CKEN10_USBHOST ;
++#elif defined( CONFIG_SM501 )
++#endif
++
++ return 0;
++}
++
++#endif /* CONFIG_USB_OHCI */
+diff -u -r --new-file u-boot-1.1.2/cpu/pxa/usb_ohci.h u-boot-1.1.2-neon/cpu/pxa/usb_ohci.h
+--- u-boot-1.1.2/cpu/pxa/usb_ohci.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/cpu/pxa/usb_ohci.h 2007-08-11 21:07:20.000000000 +0200
+@@ -0,0 +1,419 @@
++/*
++ * URB OHCI HCD (Host Controller Driver) for USB.
++ *
++ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
++ * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
++ *
++ * usb-ohci.h
++ */
++
++
++static int cc_to_error[16] = {
++
++/* mapping of the OHCI CC status to error codes */
++ /* No Error */ 0,
++ /* CRC Error */ USB_ST_CRC_ERR,
++ /* Bit Stuff */ USB_ST_BIT_ERR,
++ /* Data Togg */ USB_ST_CRC_ERR,
++ /* Stall */ USB_ST_STALLED,
++ /* DevNotResp */ -1,
++ /* PIDCheck */ USB_ST_BIT_ERR,
++ /* UnExpPID */ USB_ST_BIT_ERR,
++ /* DataOver */ USB_ST_BUF_ERR,
++ /* DataUnder */ USB_ST_BUF_ERR,
++ /* reservd */ -1,
++ /* reservd */ -1,
++ /* BufferOver */ USB_ST_BUF_ERR,
++ /* BuffUnder */ USB_ST_BUF_ERR,
++ /* Not Access */ -1,
++ /* Not Access */ -1
++};
++
++/* ED States */
++
++#define ED_NEW 0x00
++#define ED_UNLINK 0x01
++#define ED_OPER 0x02
++#define ED_DEL 0x04
++#define ED_URB_DEL 0x08
++
++/* usb_ohci_ed */
++struct ed {
++ __u32 hwINFO;
++ __u32 hwTailP;
++ __u32 hwHeadP;
++ __u32 hwNextED;
++
++ struct ed *ed_prev;
++ __u8 int_period;
++ __u8 int_branch;
++ __u8 int_load;
++ __u8 int_interval;
++ __u8 state;
++ __u8 type;
++ __u16 last_iso;
++ struct ed *ed_rm_list;
++
++ struct usb_device *usb_dev;
++ __u32 unused[3];
++} __attribute((aligned(16)));
++typedef struct ed ed_t;
++
++
++/* TD info field */
++#define TD_CC 0xf0000000
++#define TD_CC_GET(td_p) ((td_p >>28) & 0x0f)
++#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28)
++#define TD_EC 0x0C000000
++#define TD_T 0x03000000
++#define TD_T_DATA0 0x02000000
++#define TD_T_DATA1 0x03000000
++#define TD_T_TOGGLE 0x00000000
++#define TD_R 0x00040000
++#define TD_DI 0x00E00000
++#define TD_DI_SET(X) (((X) & 0x07)<< 21)
++#define TD_DP 0x00180000
++#define TD_DP_SETUP 0x00000000
++#define TD_DP_IN 0x00100000
++#define TD_DP_OUT 0x00080000
++
++#define TD_ISO 0x00010000
++#define TD_DEL 0x00020000
++
++/* CC Codes */
++#define TD_CC_NOERROR 0x00
++#define TD_CC_CRC 0x01
++#define TD_CC_BITSTUFFING 0x02
++#define TD_CC_DATATOGGLEM 0x03
++#define TD_CC_STALL 0x04
++#define TD_DEVNOTRESP 0x05
++#define TD_PIDCHECKFAIL 0x06
++#define TD_UNEXPECTEDPID 0x07
++#define TD_DATAOVERRUN 0x08
++#define TD_DATAUNDERRUN 0x09
++#define TD_BUFFEROVERRUN 0x0C
++#define TD_BUFFERUNDERRUN 0x0D
++#define TD_NOTACCESSED 0x0F
++
++
++#define MAXPSW 1
++
++struct td {
++ __u32 hwINFO;
++ __u32 hwCBP; /* Current Buffer Pointer */
++ __u32 hwNextTD; /* Next TD Pointer */
++ __u32 hwBE; /* Memory Buffer End Pointer */
++
++ __u16 hwPSW[MAXPSW];
++ __u8 unused;
++ __u8 index;
++ struct ed *ed;
++ struct td *next_dl_td;
++ struct usb_device *usb_dev;
++ int transfer_len;
++ __u32 data;
++
++ __u32 unused2[2];
++} __attribute((aligned(32)));
++typedef struct td td_t;
++
++#define OHCI_ED_SKIP (1 << 14)
++
++/*
++ * The HCCA (Host Controller Communications Area) is a 256 byte
++ * structure defined in the OHCI spec. that the host controller is
++ * told the base address of. It must be 256-byte aligned.
++ */
++
++#define NUM_INTS 32 /* part of the OHCI standard */
++struct ohci_hcca {
++ __u32 int_table[NUM_INTS]; /* Interrupt ED table */
++ __u16 frame_no; /* current frame number */
++ __u16 pad1; /* set to 0 on each frame_no change */
++ __u32 done_head; /* info returned for an interrupt */
++ u8 reserved_for_hc[116];
++} __attribute((aligned(256)));
++
++
++/*
++ * Maximum number of root hub ports.
++ */
++#define MAX_ROOT_PORTS 15 /* maximum OHCI root hub ports */
++
++/*
++ * This is the structure of the OHCI controller's memory mapped I/O
++ * region. This is Memory Mapped I/O. You must use the readl() and
++ * writel() macros defined in asm/io.h to access these!!
++ */
++struct ohci_regs {
++ /* control and status registers */
++ __u32 revision;
++ __u32 control;
++ __u32 cmdstatus;
++ __u32 intrstatus;
++ __u32 intrenable;
++ __u32 intrdisable;
++ /* memory pointers */
++ __u32 hcca;
++ __u32 ed_periodcurrent;
++ __u32 ed_controlhead;
++ __u32 ed_controlcurrent;
++ __u32 ed_bulkhead;
++ __u32 ed_bulkcurrent;
++ __u32 donehead;
++ /* frame counters */
++ __u32 fminterval;
++ __u32 fmremaining;
++ __u32 fmnumber;
++ __u32 periodicstart;
++ __u32 lsthresh;
++ /* Root hub ports */
++ struct ohci_roothub_regs {
++ __u32 a;
++ __u32 b;
++ __u32 status;
++ __u32 portstatus[MAX_ROOT_PORTS];
++ } roothub;
++} __attribute((aligned(32)));
++
++
++/* OHCI CONTROL AND STATUS REGISTER MASKS */
++
++/*
++ * HcControl (control) register masks
++ */
++#define OHCI_CTRL_CBSR (3 << 0) /* control/bulk service ratio */
++#define OHCI_CTRL_PLE (1 << 2) /* periodic list enable */
++#define OHCI_CTRL_IE (1 << 3) /* isochronous enable */
++#define OHCI_CTRL_CLE (1 << 4) /* control list enable */
++#define OHCI_CTRL_BLE (1 << 5) /* bulk list enable */
++#define OHCI_CTRL_HCFS (3 << 6) /* host controller functional state */
++#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
++#define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */
++#define OHCI_CTRL_RWE (1 << 10) /* remote wakeup enable */
++
++/* pre-shifted values for HCFS */
++# define OHCI_USB_RESET (0 << 6)
++# define OHCI_USB_RESUME (1 << 6)
++# define OHCI_USB_OPER (2 << 6)
++# define OHCI_USB_SUSPEND (3 << 6)
++
++/*
++ * HcCommandStatus (cmdstatus) register masks
++ */
++#define OHCI_HCR (1 << 0) /* host controller reset */
++#define OHCI_CLF (1 << 1) /* control list filled */
++#define OHCI_BLF (1 << 2) /* bulk list filled */
++#define OHCI_OCR (1 << 3) /* ownership change request */
++#define OHCI_SOC (3 << 16) /* scheduling overrun count */
++
++/*
++ * masks used with interrupt registers:
++ * HcInterruptStatus (intrstatus)
++ * HcInterruptEnable (intrenable)
++ * HcInterruptDisable (intrdisable)
++ */
++#define OHCI_INTR_SO (1 << 0) /* scheduling overrun */
++#define OHCI_INTR_WDH (1 << 1) /* writeback of done_head */
++#define OHCI_INTR_SF (1 << 2) /* start frame */
++#define OHCI_INTR_RD (1 << 3) /* resume detect */
++#define OHCI_INTR_UE (1 << 4) /* unrecoverable error */
++#define OHCI_INTR_FNO (1 << 5) /* frame number overflow */
++#define OHCI_INTR_RHSC (1 << 6) /* root hub status change */
++#define OHCI_INTR_OC (1 << 30) /* ownership change */
++#define OHCI_INTR_MIE (1 << 31) /* master interrupt enable */
++
++
++/* Virtual Root HUB */
++struct virt_root_hub {
++ int devnum; /* Address of Root Hub endpoint */
++ void *dev; /* was urb */
++ void *int_addr;
++ int send;
++ int interval;
++};
++
++/* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
++
++/* destination of request */
++#define RH_INTERFACE 0x01
++#define RH_ENDPOINT 0x02
++#define RH_OTHER 0x03
++
++#define RH_CLASS 0x20
++#define RH_VENDOR 0x40
++
++/* Requests: bRequest << 8 | bmRequestType */
++#define RH_GET_STATUS 0x0080
++#define RH_CLEAR_FEATURE 0x0100
++#define RH_SET_FEATURE 0x0300
++#define RH_SET_ADDRESS 0x0500
++#define RH_GET_DESCRIPTOR 0x0680
++#define RH_SET_DESCRIPTOR 0x0700
++#define RH_GET_CONFIGURATION 0x0880
++#define RH_SET_CONFIGURATION 0x0900
++#define RH_GET_STATE 0x0280
++#define RH_GET_INTERFACE 0x0A80
++#define RH_SET_INTERFACE 0x0B00
++#define RH_SYNC_FRAME 0x0C80
++/* Our Vendor Specific Request */
++#define RH_SET_EP 0x2000
++
++
++/* Hub port features */
++#define RH_PORT_CONNECTION 0x00
++#define RH_PORT_ENABLE 0x01
++#define RH_PORT_SUSPEND 0x02
++#define RH_PORT_OVER_CURRENT 0x03
++#define RH_PORT_RESET 0x04
++#define RH_PORT_POWER 0x08
++#define RH_PORT_LOW_SPEED 0x09
++
++#define RH_C_PORT_CONNECTION 0x10
++#define RH_C_PORT_ENABLE 0x11
++#define RH_C_PORT_SUSPEND 0x12
++#define RH_C_PORT_OVER_CURRENT 0x13
++#define RH_C_PORT_RESET 0x14
++
++/* Hub features */
++#define RH_C_HUB_LOCAL_POWER 0x00
++#define RH_C_HUB_OVER_CURRENT 0x01
++
++#define RH_DEVICE_REMOTE_WAKEUP 0x00
++#define RH_ENDPOINT_STALL 0x01
++
++#define RH_ACK 0x01
++#define RH_REQ_ERR -1
++#define RH_NACK 0x00
++
++
++/* OHCI ROOT HUB REGISTER MASKS */
++
++/* roothub.portstatus [i] bits */
++#define RH_PS_CCS 0x00000001 /* current connect status */
++#define RH_PS_PES 0x00000002 /* port enable status*/
++#define RH_PS_PSS 0x00000004 /* port suspend status */
++#define RH_PS_POCI 0x00000008 /* port over current indicator */
++#define RH_PS_PRS 0x00000010 /* port reset status */
++#define RH_PS_PPS 0x00000100 /* port power status */
++#define RH_PS_LSDA 0x00000200 /* low speed device attached */
++#define RH_PS_CSC 0x00010000 /* connect status change */
++#define RH_PS_PESC 0x00020000 /* port enable status change */
++#define RH_PS_PSSC 0x00040000 /* port suspend status change */
++#define RH_PS_OCIC 0x00080000 /* over current indicator change */
++#define RH_PS_PRSC 0x00100000 /* port reset status change */
++
++/* roothub.status bits */
++#define RH_HS_LPS 0x00000001 /* local power status */
++#define RH_HS_OCI 0x00000002 /* over current indicator */
++#define RH_HS_DRWE 0x00008000 /* device remote wakeup enable */
++#define RH_HS_LPSC 0x00010000 /* local power status change */
++#define RH_HS_OCIC 0x00020000 /* over current indicator change */
++#define RH_HS_CRWE 0x80000000 /* clear remote wakeup enable */
++
++/* roothub.b masks */
++#define RH_B_DR 0x0000ffff /* device removable flags */
++#define RH_B_PPCM 0xffff0000 /* port power control mask */
++
++/* roothub.a masks */
++#define RH_A_NDP (0xff << 0) /* number of downstream ports */
++#define RH_A_PSM (1 << 8) /* power switching mode */
++#define RH_A_NPS (1 << 9) /* no power switching */
++#define RH_A_DT (1 << 10) /* device type (mbz) */
++#define RH_A_OCPM (1 << 11) /* over current protection mode */
++#define RH_A_NOCP (1 << 12) /* no over current protection */
++#define RH_A_POTPGT (0xff << 24) /* power on to power good time */
++
++/* urb */
++#define N_URB_TD 48
++typedef struct
++{
++ ed_t *ed;
++ __u16 length; /* number of tds associated with this request */
++ __u16 td_cnt; /* number of tds already serviced */
++ int state;
++ unsigned long pipe;
++ int actual_length;
++ td_t *td[N_URB_TD]; /* list pointer to all corresponding TDs associated with this request */
++} urb_priv_t;
++#define URB_DEL 1
++
++/*
++ * This is the full ohci controller description
++ *
++ * Note how the "proper" USB information is just
++ * a subset of what the full implementation needs. (Linus)
++ */
++
++
++typedef struct ohci {
++ struct ohci_hcca *hcca; /* hcca */
++ /*dma_addr_t hcca_dma;*/
++
++ int irq;
++ int disabled; /* e.g. got a UE, we're hung */
++ int sleeping;
++ unsigned long flags; /* for HC bugs */
++
++ struct ohci_regs *regs; /* OHCI controller's memory */
++
++ ed_t *ed_rm_list[2]; /* lists of all endpoints to be removed */
++ ed_t *ed_bulktail; /* last endpoint of bulk list */
++ ed_t *ed_controltail; /* last endpoint of control list */
++ int intrstatus;
++ __u32 hc_control; /* copy of the hc control reg */
++ struct usb_device *dev[32];
++ struct virt_root_hub rh;
++
++ const char *slot_name;
++} ohci_t;
++
++#define NUM_EDS 8 /* num of preallocated endpoint descriptors */
++
++struct ohci_device {
++ ed_t ed[NUM_EDS];
++ int ed_cnt;
++};
++
++/* hcd */
++/* endpoint */
++static int ep_link(ohci_t * ohci, ed_t * ed);
++static int ep_unlink(ohci_t * ohci, ed_t * ed);
++static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe);
++
++/*-------------------------------------------------------------------------*/
++
++/* we need more TDs than EDs */
++#define NUM_TD 64
++
++/* +1 so we can align the storage */
++td_t gtd[NUM_TD+1];
++/* pointers to aligned storage */
++td_t *ptd;
++
++/* TDs ... */
++static inline struct td *
++td_alloc (struct usb_device *usb_dev)
++{
++ int i;
++ struct td *td;
++
++ td = NULL;
++ for (i = 0; i < NUM_TD; i++)
++ {
++ if (ptd[i].usb_dev == NULL)
++ {
++ td = &ptd[i];
++ td->usb_dev = usb_dev;
++ break;
++ }
++ }
++
++ return td;
++}
++
++static inline void
++ed_free (struct ed *ed)
++{
++ ed->usb_dev = NULL;
++}
+diff -u -r --new-file u-boot-1.1.2/.cvsignore u-boot-1.1.2-neon/.cvsignore
+--- u-boot-1.1.2/.cvsignore 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/.cvsignore 2007-08-11 21:07:19.000000000 +0200
+@@ -0,0 +1,13 @@
++*.map
++*.scr
++*.gz
++select.h
++*.log
++select.mk
++u-boot
++u-boot.bin
++u-boot.map
++u-boot.map.sorted
++u-boot.srec
++u-boot-binaries.zip
++
+diff -u -r --new-file u-boot-1.1.2/drivers/lan91c96.h u-boot-1.1.2-neon/drivers/lan91c96.h
+--- u-boot-1.1.2/drivers/lan91c96.h 2004-06-07 00:11:41.000000000 +0200
++++ u-boot-1.1.2-neon/drivers/lan91c96.h 2007-08-11 21:07:21.000000000 +0200
+@@ -76,7 +76,7 @@
+
+ #define SMC_IO_EXTENT 16
+
+-#ifdef CONFIG_PXA250
++#if defined( CONFIG_PXA250 ) || defined( CONFIG_PXA270 )
+
+ #define SMC_inl(r) (*((volatile dword *)(SMC_BASE_ADDRESS+( r * 4 ))))
+ #define SMC_inw(r) (*((volatile word *)(SMC_BASE_ADDRESS+( r * 4 ))))
+@@ -139,7 +139,7 @@
+ }; \
+ })
+
+-#else /* if not CONFIG_PXA250 */
++#else /* if not CONFIG_PXA250 or CONFIG_PXA270 */
+
+ /*
+ * We have only 16 Bit PCMCIA access on Socket 0
+diff -u -r --new-file u-boot-1.1.2/drivers/smc91111.c u-boot-1.1.2-neon/drivers/smc91111.c
+--- u-boot-1.1.2/drivers/smc91111.c 2004-11-22 23:20:09.000000000 +0100
++++ u-boot-1.1.2-neon/drivers/smc91111.c 2007-08-11 21:07:21.000000000 +0200
+@@ -1583,6 +1583,101 @@
+ return (0);
+ }
+
++#define SMC_GET_INT_MASK() (SMC_inw( SMC91111_INT_REG ) >> 8)
++#define SMC_SET_INT_MASK(x) SMC_outw( (x) << 8, SMC91111_INT_REG )
++#define SMC_CURRENT_BANK() SMC_inw( BANK_SELECT )
++#define SMC_GET_CTL() SMC_inw( CTL_REG )
++#define SMC_SET_CTL(x) SMC_outw( x, CTL_REG )
++#define SMC_GET_MII() SMC_inw( MII_REG )
++#define SMC_SET_MII(x) SMC_outw( x, MII_REG )
++#define SMC_GET_PTR() SMC_inw( PTR_REG )
++#define SMC_SET_PTR(x) SMC_outw( x, PTR_REG )
++
++static int writeEEprom(int i,unsigned short val,unsigned short ctl)
++{
++ SMC_SELECT_BANK( 2 );
++ SMC_SET_PTR( i );
++ SMC_SELECT_BANK( 1 );
++ SMC_outw( val, GP_REG );
++ udelay(1);
++ SMC_SET_CTL( ctl | CTL_EEPROM_SELECT | CTL_STORE );
++ int j=0;
++ do {
++ udelay(10);
++ j++;
++ if (j>=100000) return -1;
++ } while (SMC_GET_CTL() & CTL_STORE);
++ return 0;
++}
++
++#define SMC_SET_MAC_ADDR(addr) \
++ do { \
++ SMC_outw( addr[0]|(addr[1] << 8), ADDR0_REG ); \
++ SMC_outw( addr[2]|(addr[3] << 8), ADDR1_REG ); \
++ SMC_outw( addr[4]|(addr[5] << 8), ADDR2_REG ); \
++ } while (0)
++
++int set_rom_mac (char const *mac)
++{
++ unsigned short saved_bank = SMC_CURRENT_BANK();
++ SMC_SELECT_BANK( 2 );
++
++ unsigned short saved_mask = SMC_GET_INT_MASK();
++ SMC_SET_INT_MASK( 0 );
++
++ unsigned short saved_ptr = SMC_GET_PTR();
++
++ SMC_SELECT_BANK( 1 );
++
++ unsigned short saved_ctl = SMC_GET_CTL();
++
++ SMC_SET_MAC_ADDR(mac);
++
++ SMC_SELECT_BANK( 3 );
++ unsigned short mii_reg = SMC_GET_MII();
++
++ SMC_SET_MII(mii_reg & ~(0x0f));
++
++ SMC_SELECT_BANK( 1 );
++
++ SMC_SET_CTL( saved_ctl | CTL_EEPROM_SELECT );
++ unsigned short cfg = CONFIG_DEFAULT
++ | CONFIG_NO_WAIT
++ | CONFIG_EPH_POWER_EN;
++ unsigned short bar = (unsigned short)( SMC_BASE_ADDRESS );
++//a4, a10,a11,a12 must be all zeros
++ bar = (bar & 0xe000) | ((bar & 0x3e0)<<3) | (0x27);
++ int i=0;
++ while (i < 0x20) {
++ if (writeEEprom(i,cfg,saved_ctl)) break;
++ if (writeEEprom(i+1,bar,saved_ctl)) break;
++ if (writeEEprom(i+2,0,saved_ctl)) break;
++ if (writeEEprom(i+3,0,saved_ctl)) break;
++ i+=4;
++ }
++
++ int j = 0;
++ if (i==0x20) {
++ while (j < 6) {
++ if (writeEEprom(i,mac[j]|(mac[j+1]<<8),saved_ctl)) break;
++ i++; j+=2;
++ }
++ }
++
++ SMC_SET_CTL( saved_ctl );
++
++ SMC_SELECT_BANK( 2 );
++ SMC_SET_PTR( saved_ptr );
++ SMC_SET_INT_MASK( saved_mask );
++ SMC_SELECT_BANK( saved_bank );
++
++ return 6 == j ;
++}
++
++static char const invalidMac[6] = {
++ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
++};
++
+ int get_rom_mac (char *v_rom_mac)
+ {
+ #ifdef HARDCODE_MAC /* used for testing or to supress run time warnings */
+@@ -1601,6 +1696,9 @@
+ valid_mac |= v_rom_mac[i];
+ }
+
++ if( valid_mac )
++ valid_mac = ( 0 != memcmp( invalidMac, v_rom_mac, sizeof(invalidMac) ) );
++
+ return (valid_mac ? 1 : 0);
+ #endif
+ }
+diff -u -r --new-file u-boot-1.1.2/drivers/smc91111.h u-boot-1.1.2-neon/drivers/smc91111.h
+--- u-boot-1.1.2/drivers/smc91111.h 2004-11-02 14:00:56.000000000 +0100
++++ u-boot-1.1.2-neon/drivers/smc91111.h 2007-08-11 21:07:21.000000000 +0200
+@@ -74,7 +74,7 @@
+
+ #define SMC_IO_EXTENT 16
+
+-#ifdef CONFIG_PXA250
++#if defined( CONFIG_PXA250 ) || defined( CONFIG_PXA270 )
+
+ #ifdef CONFIG_XSENGINE
+ #define SMC_inl(r) (*((volatile dword *)(SMC_BASE_ADDRESS+(r<<1))))
+@@ -176,7 +176,7 @@
+ }; \
+ })
+
+-#else /* if not CONFIG_PXA250 */
++#else /* if not CONFIG_PXA250 or CONFIG_PXA270 */
+
+ #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
+ /*
+diff -u -r --new-file u-boot-1.1.2/examples/Makefile u-boot-1.1.2-neon/examples/Makefile
+--- u-boot-1.1.2/examples/Makefile 2004-10-10 23:27:33.000000000 +0200
++++ u-boot-1.1.2-neon/examples/Makefile 2007-08-11 21:07:21.000000000 +0200
+@@ -100,12 +100,12 @@
+ LIBCOBJS= stubs.o
+ LIBOBJS = $(LIBAOBJS) $(LIBCOBJS)
+
+-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
+-clibdir := $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
++gcclibdir := $(shell dirname "`$(CC) -print-libgcc-file-name`")
++clibdir := $(shell dirname "`$(CC) $(CFLAGS) -print-file-name=libc.a`")
+
+ CPPFLAGS += -I..
+
+-all: .depend $(LIB) $(SREC) $(BIN)
++all: .depend $(LIB)
+
+ #########################################################################
+ $(LIB): .depend $(LIBOBJS)
+diff -u -r --new-file u-boot-1.1.2/fs/fat/fat.c u-boot-1.1.2-neon/fs/fat/fat.c
+--- u-boot-1.1.2/fs/fat/fat.c 2004-12-16 18:57:26.000000000 +0100
++++ u-boot-1.1.2-neon/fs/fat/fat.c 2007-08-11 21:07:21.000000000 +0200
+@@ -52,6 +52,8 @@
+ #define DOS_PART_TBL_OFFSET 0x1be
+ #define DOS_PART_MAGIC_OFFSET 0x1fe
+ #define DOS_FS_TYPE_OFFSET 0x36
++#define DOS_FS_TYPE_OFFSET_FAT_16 0x36 // Code relating to this constant was changed/added by Dubner 2005-05-20
++#define DOS_FS_TYPE_OFFSET_FAT_32 0x52 // Code relating to this constant was changed/added by Dubner 2005-05-20
+
+ int disk_read (__u32 startblock, __u32 getsize, __u8 * bufptr)
+ {
+@@ -83,7 +85,8 @@
+ /* no signature found */
+ return -1;
+ }
+- if(!strncmp(&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
++ if(!strncmp(&buffer[DOS_FS_TYPE_OFFSET_FAT_16],"FAT",3)
++ || !strncmp (&buffer[DOS_FS_TYPE_OFFSET_FAT_32], "FAT", 3)) {
+ /* ok, we assume we are on a PBR only */
+ cur_part = 1;
+ part_offset=0;
+@@ -342,7 +345,7 @@
+ newclust = get_fatent(mydata, endclust);
+ if((newclust -1)!=endclust)
+ goto getit;
+- if (newclust <= 0x0001 || newclust >= 0xfff0) {
++ if (newclust <= 0x0001 ) { // || newclust >= 0xfff0) {
+ FAT_DPRINT("curclust: 0x%x\n", newclust);
+ FAT_DPRINT("Invalid FAT entry\n");
+ return gotsize;
+@@ -890,7 +893,7 @@
+ dentptr++;
+ continue;
+ }
+- if (strcmp (fnamecopy, s_name) && strcmp (fnamecopy, l_name)) {
++ if (fnmatch(fnamecopy, s_name,0) && fnmatch(fnamecopy, l_name,0)) {
+ FAT_DPRINT ("RootMismatch: |%s|%s|\n", s_name, l_name);
+ dentptr++;
+ continue;
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/BigMacro.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/BigMacro.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/BigMacro.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/BigMacro.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,325 @@
++//
++// linux/include/asm-arm/BigMacro.h
++//
++// Author: Troy Kisky
++// Created: Jun 30, 2002
++// Copyright: Boundary Devices
++//
++// This program is free software; you can redistribute it and/or modify
++// it under the terms of the GNU General Public License version 2 as
++// published by the Free Software Foundation.
++//
++ .nolist
++
++//find set bit pair >= curbit
++//out: __nBit
++ .ifdef __ARMASM
++ GBLA __nBit
++ GBLA __nMask
++ GBLA __nVal
++; DCD __nV1
++
++.macro NextSetBitUp val,curBit
++ LCLA __nV1
++ .set __nBit,(\curBit)
++ .set __nV1,(\val)
++ WHILE ( (__nBit < 30) :LAND: ( (__nV1 :AND: (0x03:SHL:__nBit))=0) )
++ .set __nBit,(__nBit)+2
++ WEND
++.endm
++
++//find set bit pair <= curbit
++//out: __nBit
++.macro NextSetBitDown val,curBit
++ LCLA __nV1
++ .set __nBit,(\curBit)
++ .set __nV1,(\val)
++ WHILE ( (__nBit <> 0) :LAND: ( (__nV1:AND:(0xc0:SHL:__nBit))=0) )
++ .set __nBit,(__nBit)-2
++ WEND
++.endm
++ .else
++
++.macro NextSetBitUp val,curBit
++ .set __nBit,(\curBit)
++ .set __nV1,(\val)
++ .if ((__nV1) & (0x03<<(__nBit)))
++ .else
++ .if ((__nBit)-30)
++ NextSetBitUp __nV1,((__nBit)+2)
++ .endif
++ .endif
++ .set __nV1,0
++.endm
++
++//find set bit pair <= curbit
++//out: __nBit
++.macro NextSetBitDown val,curBit
++ .set __nBit,(\curBit)
++ .set __nV1,(\val)
++ .if ((__nV1)&(0xc0<<(__nBit)))
++ .else
++ .if (__nBit)
++ NextSetBitDown __nV1,((__nBit)-2)
++ .endif
++ .endif
++ .set __nV1,0
++.endm
++ .endif
++
++//OUT: __nMask
++.macro NextSetMask val
++ NextSetBitDown \val,24
++ .if (__nBit>=20)
++ NextSetBitUp \val,__nBit
++ .set __nMask,(0xff<<((__nBit)-16))
++ .set __nMask,(((__nMask)>>16)+(((__nMask)<<16)&0xffff0000))
++ .else
++ .set __nMask,(0xff<<(__nBit))
++ .endif
++
++.endm
++
++.macro Big2CC inst,dest,val
++ .set __nVal,(\val)
++ .if (__nVal)<>0
++ NextSetMask __nVal
++ \inst \dest,\dest,#(__nVal)&(__nMask)
++ Big2CC \inst,\dest,(__nVal)&~(__nMask)
++ .endif
++.endm
++
++.macro BigAnd2CC cc,dest,val
++ .set __nVal,(\val)
++ .if (~__nVal)<>0
++ NextSetMask __nVal
++ .if (((__nVal)&~(__nMask))=0)
++ and\cc \dest,\dest,#(__nVal)&(__nMask)
++ .else
++ Big2CC bic\cc,\dest,~__nVal
++ .endif
++ .endif
++.endm
++
++///////////////////////////////////////////////////////
++.macro BigMovCC cc,dest, val
++ .set __nVal,(\val)
++ NextSetMask ~__nVal
++ .if (((~(__nVal))&~(__nMask)) > 0x255)
++ NextSetMask __nVal
++ mov\cc \dest,#(__nVal)&(__nMask)
++ .if (((__nVal)&0xffff) ^ (((__nVal)>>16)&0xffff))<>0
++ Big2CC orr\cc,\dest,(__nVal)&~(__nMask)
++ .else
++ .set __nVal,(__nVal)&~(__nMask)
++ .if (__nVal)<>0
++ NextSetMask __nVal
++ orr\cc \dest,\dest,#(__nVal)&(__nMask)
++ .set __nVal,(__nVal)&~(__nMask)
++ .if (__nVal)<>0
++ orr\cc \dest,\dest,\dest,LSR #16
++ .endif
++ .endif
++ .endif
++ .else
++ mvn\cc \dest,#(~(__nVal))&(__nMask) //complement of complement is original
++ Big2CC bic\cc,\dest,(~(__nVal))&~(__nMask)
++ .endif
++.endm
++
++
++.macro BigAddCC cc,dest,src,val
++ .set __nVal,(\val)
++ .if (__nVal)<>0
++ NextSetMask -__nVal
++ .if (((-(__nVal))&~(__nMask)) > 0x255)
++ NextSetMask __nVal
++ add\cc \dest,\src,#(__nVal)&(__nMask)
++ Big2CC add\cc,\dest,(__nVal)&~(__nMask)
++ .else
++ sub\cc \dest,\src,#(-(__nVal))&(__nMask)
++ Big2CC sub\cc,\dest,(-(__nVal))&~(__nMask)
++ .endif
++ .else
++ mov\cc \dest,\src
++ .endif
++.endm
++
++.macro BigSubCC cc,dest,src,val
++ .set __nVal,(\val)
++ BigAddCC \cc,\dest,\src,-__nVal
++.endm
++
++.macro BigCC inst,cc,dest,src,val
++ .set __nVal,(\val)
++ .if (__nVal)<>0
++ NextSetMask __nVal
++ \inst\cc \dest,\src,#(__nVal)&(__nMask)
++ Big2CC \inst\cc,\dest,(__nVal)&~(__nMask)
++ .else
++ mov\cc \dest,\src
++ .endif
++.endm
++
++
++.macro BigAndCC cc,dest,src,val
++ .set __nVal,(\val)
++ .if (~__nVal)<>0
++ NextSetMask __nVal
++ .if (((__nVal)&~(__nMask))=0)
++ and\cc \dest,\src,#(__nVal)&(__nMask)
++ .else
++ BigCC bic,\cc,\dest,\src,~__nVal
++ .endif
++ .else
++ mov\cc \dest,\src
++ .endif
++.endm
++
++/////////////////////////////////////
++//dest, value
++.macro BigAdd2 dest,val
++ Big2CC add,\dest,\val
++.endm
++.macro BigAdd2Eq dest,val
++ Big2CC addeq,\dest,\val
++.endm
++.macro BigAdd2Ne dest,val
++ Big2CC addne,\dest,\val
++.endm
++
++.macro BigSub2 dest,val
++ Big2CC sub,\dest,\val
++.endm
++.macro BigSub2Eq dest,val
++ Big2CC subeq,\dest,\val
++.endm
++.macro BigSub2Ne dest,val
++ Big2CC subne,\dest,\val
++.endm
++
++.macro BigOrr2 dest,val
++ Big2CC orr,\dest,\val
++.endm
++.macro BigOrr2Eq dest,val
++ Big2CC orreq,\dest,\val
++.endm
++.macro BigOrr2Ne dest,val
++ Big2CC orrne,\dest,\val
++.endm
++
++.macro BigEor2 dest,val
++ Big2CC eor,\dest,\val
++.endm
++.macro BigEor2Eq dest,val
++ Big2CC eoreq,\dest,\val
++.endm
++.macro BigEor2Ne dest,val
++ Big2CC eorne,\dest,\val
++.endm
++.macro BigEor2Cs dest,val
++ Big2CC eorcs,\dest,\val
++.endm
++.macro BigEor2Cc dest,val
++ Big2CC eorcc,\dest,\val
++.endm
++
++.macro BigBic2 dest,val
++ Big2CC bic,\dest,\val
++.endm
++.macro BigBic2Eq dest,val
++ Big2CC biceq,\dest,\val
++.endm
++.macro BigBic2Ne dest,val
++ Big2CC bicne,\dest,\val
++.endm
++
++.macro BigAnd2 dest,val
++ BigAnd2CC al,\dest,\val
++.endm
++.macro BigAnd2Eq dest,val
++ BigAnd2CC eq,\dest,\val
++.endm
++.macro BigAnd2Ne dest,val
++ BigAnd2CC ne,\dest,\val
++.endm
++/////////////////////////////////////
++
++.macro BigMov dest,val
++ BigMovCC al,\dest,\val
++.endm
++.macro BigMovEq dest,val
++ BigMovCC eq,\dest,\val
++.endm
++.macro BigMovNe dest,val
++ BigMovCC ne,\dest,\val
++.endm
++// dest,src,value
++.macro BigAdd dest,src,val
++ BigAddCC al,\dest,\src,\val
++.endm
++.macro BigAddEq dest,src,val
++ BigAddCC eq,\dest,\src,\val
++.endm
++.macro BigAddNe dest,src,val
++ BigAddCC ne,\dest,\src,\val
++.endm
++
++.macro BigSub dest,src,val
++ BigSubCC al,\dest,\src,\val
++.endm
++.macro BigSubEq dest,src,val
++ BigSubCC eq,\dest,\src,\val
++.endm
++.macro BigSubNe dest,src,val
++ BigSubCC ne,\dest,\src,\val
++.endm
++
++.macro BigOrr dest,src,val
++ BigCC orr,al,\dest,\src,\val
++.endm
++.macro BigOrrEq dest,src,val
++ BigCC orr,eq,\dest,\src,\val
++.endm
++.macro BigOrrNe dest,src,val
++ BigCC orr,ne,\dest,\src,\val
++.endm
++
++.macro BigEor dest,src,val
++ BigCC eor,al,\dest,\src,\val
++.endm
++.macro BigEorEq dest,src,val
++ BigCC eor,eq,\dest,\src,\val
++.endm
++.macro BigEorNe dest,src,val
++ BigCC eor,ne,\dest,\src,\val
++.endm
++.macro BigEorCs dest,src,val
++ BigCC eor,cs,\dest,\src,\val
++.endm
++.macro BigEorCc dest,src,val
++ BigCC eor,cc,\dest,\src,\val
++.endm
++
++.macro BigBic dest,src,val
++ BigCC bic,al,\dest,\src,\val
++.endm
++.macro BigBicEq dest,src,val
++ BigCC bic,eq,\dest,\src,\val
++.endm
++.macro BigBicNe dest,src,val
++ BigCC bic,ne,\dest,\src,\val
++.endm
++
++.macro BigAnd dest,src,val
++ BigAndCC al,\dest,\src,\val
++.endm
++.macro BigAndEq dest,src,val
++ BigAndCC eq,\dest,\src,\val
++.endm
++.macro BigAndNe dest,src,val
++ BigAndCC ne,\dest,\src,\val
++.endm
++
++// *******************************************************************************************
++ .list
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/burn.inc u-boot-1.1.2-neon/include/asm-arm/arch-pxa/burn.inc
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/burn.inc 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/burn.inc 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,367 @@
++#define FLASH_GPIO_STATUS 0 //1 means use gp to tell when flash is ready
++
++#if (PLATFORM_TYPE==NEONB)
++#define FLASH_BASE_ADDRESS 0x04000000
++#else
++#define FLASH_BASE_ADDRESS 0x0
++#endif
++
++
++#define FLASH_ID_CMD ((0x0090<<16) + 0x0090) //read Identifier Codes
++#define FLASH_STATUS_CMD ((0x0070<<16) + 0x0070)
++#define FLASH_STATUS_CLEAR_CMD ((0x0050<<16) + 0x0050)
++#define FLASH_READ_CMD ((0x00FF<<16) + 0x00FF) //Read Array/Reset
++#define FLASH_ERASE_CMD ((0x0020<<16) + 0x0020) //Block Erase
++#define FLASH_CONFIRM_CMD ((0x00D0<<16) + 0x00D0) //Block Erase and Program Resume
++//#define FLASH_WRITE_CMD ((0x0040<<16) + 0x0040) //Program word
++#define FLASH_WRITE_TO_BUFFER_CMD ((0x00E8<<16) + 0x00E8) //Program word
++
++#define FLASH_SUCCESS_RSP ((0x0080<<16) + 0x0080)
++
++#define stmicro_manCode ((0x0020<<16) + 0x0020)
++#define intel_manCode ((0x0089<<16) + 0x0089)
++#define SECT_SIZE (1<<18) //256k
++
++#define f320j3a_devCode ((0x0016<<16) + 0x0016)
++#define f320j3a_NUM_SECTORS 32 //for 8M flash
++#define f320j3a_SIZE (f320j3a_NUM_SECTORS*SECT_SIZE)
++
++#define f640j3a_devCode ((0x0017<<16) + 0x0017)
++#define f640j3a_NUM_SECTORS 64 //for 16M flash (8 meg on 16bit boards)
++#define f640j3a_SIZE (f640j3a_NUM_SECTORS*SECT_SIZE)
++
++#define f128j3a_devCode ((0x0018<<16) + 0x0018)
++#define f128j3a_NUM_SECTORS 128 //for 32M flash
++#define f128j3a_SIZE (f128j3a_NUM_SECTORS*SECT_SIZE)
++// *****************************
++#define MANCODE 0
++#define DEVCODE 4
++
++
++
++#define rRet r6
++#define rRamSectorEnd r7
++#define rRamSector rNum1
++#define rRamEnd rNum2
++#define rFlashBase sl //r10
++#define rFlashSector fp //r11
++
++#define CMD_BURN 0
++#define CMD_VERIFY 1
++#define CMD_BURNALL 2
++
++.macro delayCnt rTemp,cnt
++ mov \rTemp,#\cnt
++90: subs \rTemp,\rTemp,#1
++ bne 90b
++.endm
++// *********************************
++//default delay is for write recovery before read, allow 400 MHZ cpu
++.macro delay
++ delayCnt r4,((40/10)*COUNT_MULT)
++.endm
++
++
++
++.macro FLASH_GPIO_WAIT_FOR_IDLE
++ .if FLASH_GPIO_STATUS
++ bl FlashGpioWaitForIdle
++ .endif
++.endm
++
++.macro DEFINE_FLASH_GPIO_WAIT_FOR_IDLE
++ .if FLASH_GPIO_STATUS
++FlashGpioWaitForIdle:
++//500 ns delay for STS going low
++ delayCnt r4,((500/10)*COUNT_MULT) //500ns /10ns (for 100MHZ cpu cycle time) * 4 (100MHZ cpu)
++ mov r5,#0x300000
++ BigMov r4,GPIO_BASE
++91: ldr r2,[r4,#GPLR0]
++ and r2,r2,#3
++ cmp r2,#3
++ subnes r5,r5,#1
++ bne 91b
++ mov pc,lr //return
++ .endif
++.endm
++
++//out: z-1 timeout
++.macro waitForReady istr,ildr,mask,inc
++ BigMov r2,FLASH_STATUS_CMD&\mask
++ \istr r2,[r1,#-\inc]
++
++ FLASH_GPIO_WAIT_FOR_IDLE
++ BigMov r3,FLASH_SUCCESS_RSP&\mask
++
++ mov r5,#0x300000*COUNT_MULT
++ .if FLASH_GPIO_STATUS
++ b 92f
++ .endif
++
++71:
++ delayCnt r4,((500/10)*COUNT_MULT)
++92: \ildr r4,[r1,#-\inc] //!!! read status
++ and r4,r4,r3
++ cmp r4,r3
++ subnes r5,r5,#1
++ bne 71b
++
++ BigMov r2,FLASH_READ_CMD&\mask
++ \istr r2,[r1,#-\inc]
++ delay
++ teq r5,#0
++.endm
++
++
++
++//out: z-1 timeout
++.macro WaitForEraseDone istr,ildr,mask
++ FLASH_GPIO_WAIT_FOR_IDLE
++ BigMov r3,FLASH_SUCCESS_RSP&\mask
++ mov r5,#0x10000
++92:
++ delayCnt r4,0x3000
++ \ildr r4,[rFlashSector]
++ and r4,r4,r3
++ cmp r4,r3
++ subnes r5,r5,#1
++ bne 92b
++
++ BigMov r2,FLASH_READ_CMD&\mask
++ \istr r2,[rFlashSector,#0]
++ delay
++ teq r5,#0
++.endm
++// ***********************************
++
++//r5 - command - CMD_BURN or CMD_BURNALL
++//rRet(r6) succesful burn return address
++//rRamSectorEnd(r7) - but not an input, just how it is used
++//rRamSector(r8) - start
++//rRamEnd(r9) - end
++//rFlashBase(sl,r10) - flash base
++//rFlashSector(fp,r11) - starting flash sector
++//rDBG(sp,r13)
++//lr - return address on failure
++
++.macro BurnRtn istr,ildr,mask,shift,sizeShift,inc,plait
++ str r5,[rDBG,#DBG_TEMP]
++ BigMov r0,FLASH_STATUS_CLEAR_CMD&\mask
++ \istr r0,[rFlashBase,#0]
++ delay
++ BigMov r0,FLASH_ID_CMD&\mask
++ \istr r0,[rFlashBase,#0]
++ delay
++ BigMov r4,intel_manCode&\mask
++ BigMov r1,stmicro_manCode&\mask
++ BigMov r5,f320j3a_devCode&\mask
++ \ildr r2,[rFlashBase,#MANCODE>>\shift]
++ \ildr r3,[rFlashBase,#DEVCODE>>\shift]
++
++ BigMov r0,FLASH_READ_CMD&\mask
++ \istr r0,[rFlashBase,#0]
++ delayCnt r0,((40/10)*COUNT_MULT)
++
++ mov r0,#f320j3a_SIZE>>\sizeShift
++ cmp r3,r5
++
++ BigMovNe r5,f128j3a_devCode&\mask
++ movne r0,#f128j3a_SIZE>>\sizeShift
++ cmpne r3,r5
++
++ BigMovNe r5,f640j3a_devCode&\mask
++ movne r0,#f640j3a_SIZE>>\sizeShift
++ cmpne r3,r5
++
++ cmpeq r2,r4
++ cmpne r2,r1
++ movne r0,#MANCODE>>2
++ movne r1,#DEVCODE>>2
++ movne pc,lr //return if unrecognized chip
++
++ sub r1,rRamEnd,rRamSector
++ sub r2,rFlashSector,rFlashBase
++ add r1,r1,r2
++ cmp r1,r0
++ movhi pc,lr //return if trying to write too much
++
++ ldrb r5,[rDBG,#DBG_TEMP]
++ cmp r5,#CMD_BURNALL
++ streq r0,[rDBG,#DBG_TEMP] //r0 is size of flash
++
++ FLASH_GPIO_WAIT_FOR_IDLE
++1:
++ bl PrintSector
++
++//Now see if block needs erased
++ add rRamSectorEnd,rRamSector,#SECT_SIZE>>\shift
++ cmp rRamSectorEnd,rRamEnd
++ movhi rRamSectorEnd,rRamEnd
++ b 3f
++2:
++ ldr r2,[r0],#4 //read ram
++ ldr r3,[r1],#4 //read flash
++ and r4,r3,r2
++ cmp r4,r2
++ bne 10f
++3: cmp r0,rRamSectorEnd
++ blo 2b
++
++
++ ldr r2,[rDBG,#DBG_TEMP]
++ movs r2,r2
++ beq 20f
++ add r0,rFlashSector,#SECT_SIZE>>\shift
++ b 62f
++61:
++ ldr r2,[r1],#4 //read flash
++ adds r2,r2,#1
++ bne 10f
++62: cmp r1,r0
++ blo 61b
++ b 19f //erase not needed
++
++//erase
++10:
++ BigMov r3,FLASH_READ_CMD&\mask
++ \istr r3,[rFlashBase,#0]
++ delay
++ ldr r3,[r1,#-4] //read flash
++ and r4,r3,r2
++ cmp r4,r2
++ beq 3b //br if (we signal) glitch caused a spurious status register read
++
++ BigMov r0,FLASH_ERASE_CMD&\mask
++ \istr r0,[rFlashSector]
++ BigMov r0,FLASH_CONFIRM_CMD&\mask
++ \istr r0,[rFlashSector]
++ bl PrintErasing
++
++ WaitForEraseDone \istr,\ildr,\mask
++ beq Timeout //br if erase timed out
++
++ .if (\plait)
++ BigMov r0,FLASH_ERASE_CMD&\mask
++ \istr r0,[rFlashSector,#2]
++ BigMov r0,FLASH_CONFIRM_CMD&\mask
++ \istr r0,[rFlashSector,#2]
++ bl PrintErasing
++
++ WaitForEraseDone \istr,\ildr,\mask
++ beq Timeout //br if erase timed out
++ .endif
++
++19: cmp rRamSector,rRamSectorEnd
++ bhs 42f
++
++//programming
++20:
++ bl PrintProgramming
++21:
++ ldr r2,[r0],#4 //read ram
++ ldr r3,[r1],#4 //read flash
++ cmp r2,r3
++ bne 22f
++28:
++ cmp r0,rRamSectorEnd
++ blo 21b
++ b 30f //goto verify
++
++22:
++ sub r1,r1,#4
++ sub r0,r0,#4
++ and r2,r1,#0x3f>>\shift //align to a 64 byte boundary (32 per device)
++ sub r1,r1,r2
++ sub r0,r0,r2
++
++ BigMov r2,FLASH_WRITE_TO_BUFFER_CMD&\mask
++ \istr r2,[r1] //!!! write_to_buffer
++
++ sub r3,rRamSectorEnd,r0
++ mov r3,r3,LSR #2-\shift
++ sub r3,r3,#1
++ cmp r3,#0x0f
++ movhi r3,#0x0f
++ orr r2,r3,r3,LSL #16
++ \istr r2,[r1] //!!! word cnt -1
++25: \ildr r2,[r0],#\inc
++ \istr r2,[r1],#\inc //!!! words
++ subs r3,r3,#1
++ bpl 25b
++ BigMov r2,FLASH_CONFIRM_CMD&\mask
++ \istr r2,[r1,#-\inc] //!!! confirm
++
++ waitForReady \istr,\ildr,\mask,\inc
++
++ .if (\plait)
++ beq 88f
++ sub r1,r1,#\inc
++ sub r0,r0,#\inc
++ and r2,r1,#0x3f>>\shift //align to a 64 byte boundary (32 per device)
++ sub r1,r1,r2
++ sub r0,r0,r2
++
++ BigMov r2,FLASH_WRITE_TO_BUFFER_CMD&\mask
++ \istr r2,[r1,#2]! //!!! write_to_buffer
++ sub r3,rRamSectorEnd,r0
++ add r0,r0,#2
++ mov r3,r3,LSR #2-\shift
++ sub r3,r3,#1
++ cmp r3,#0x0f
++ movhi r3,#0x0f
++ orr r2,r3,r3,LSL #16
++ \istr r2,[r1] //!!! word cnt -1
++85: \ildr r2,[r0],#\inc
++ \istr r2,[r1],#\inc //!!! words
++ subs r3,r3,#1
++ bpl 85b
++ BigMov r2,FLASH_CONFIRM_CMD&\mask
++ \istr r2,[r1,#-\inc] //!!! confirm
++
++ waitForReady \istr,\ildr,\mask,\inc
++ sub r0,r0,#2
++ sub r1,r1,#2
++
++ bne 28b
++88:
++
++ .else
++ bne 28b
++ .endif
++ sub rRamSector,r0,#0x40>>\shift //whoops, timeout
++ sub rFlashSector,r1,#0x40>>\shift
++ b Timeout
++
++
++
++//verify
++30:
++ bl PrintVerifying
++31:
++ ldr r2,[r0],#4 //read ram
++ ldr r3,[r1],#4 //read flash
++ cmp r2,r3
++ bne 33f
++32: cmp r0,rRamSectorEnd
++ blo 31b
++42:
++ add rRamSector,rRamSector,#SECT_SIZE>>\shift
++ add rFlashSector,rFlashSector,#SECT_SIZE>>\shift
++ cmp rRamSector,rRamEnd
++ blo 1b //goto next sector
++
++ ldr r2,[rDBG,#DBG_TEMP]
++ add r2,r2,rFlashBase
++ cmp rFlashSector,r2
++ blo 1b
++
++ b PrintSuccess
++33:
++ BigMov r3,FLASH_READ_CMD&\mask
++ \istr r3,[rFlashBase,#0]
++ delay
++ ldr r3,[r1,#-4] //read flash
++ cmp r2,r3
++ beq 32b //br if (we signal) glitch caused a spurious status register read
++ b ReturnError
++.endm
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/miniMac.inc u-boot-1.1.2-neon/include/asm-arm/arch-pxa/miniMac.inc
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/miniMac.inc 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/miniMac.inc 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,476 @@
++#include "platformTypes.h"
++#define SUB_LR_FALL_THRU_FOR_FIQ 1 //0 for branch
++#define LITTLE_ENDIAN 1 //describes memory system
++#define DDEBUG 0
++#define DO_GPTEST 0
++
++#define MACH_TYPE_SCANPASS 332
++
++#define ATAG_CORE 0x54410001
++#define ATAG_MEM 0x54410002
++#define TAGGED_LIST 0xa0000100
++ .ifdef __ARMASM
++ GBLA STACKS_VALID
++ GBLA CONFIG_STACKS_VALID
++ .set CONFIG_STACKS_VALID,1
++ .endif
++
++#if (SOFTWARE_TYPE==WINCE)
++ .set STACKS_VALID,1
++ .ifdef __ARMASM
++ .else
++#ifndef CONFIG_STACKS_VALID
++#define CONFIG_STACKS_VALID 1
++#endif
++ .endif
++
++#define SDRAM_BASE_C_VIRTUAL 0xA0000000 //0x80000000 is cached mapped, 0xa0000000 is uncacheable
++#define UART_VIRT_BASE 0xAA100000
++#define VMA_DEBUG (0xfff00000)
++#define VIRTUAL_CS0 0xa8000000
++#define VIRTUAL_CS1 0xa8000000
++
++#else
++#ifdef CONFIG_STACKS_VALID
++ .set STACKS_VALID,1
++#else
++ .set STACKS_VALID,0
++#endif
++#define SDRAM_BASE_C_VIRTUAL 0xC0000000
++#define UART_VIRT_BASE 0xf8100000
++//#define VMA_DEBUG 0xff000000
++//!!!!!for some reason the above base causes bizarre problems
++#define VMA_DEBUG (0xfff00000)
++#define VIRTUAL_CS0 0xff000000
++#define VIRTUAL_CS1 0xff100000
++#endif
++
++#define V_rWork r2
++#define V_rBranch r3
++#define I_rWork r2
++#define I_rBranch sp //r13
++
++#ifdef CONFIG_STACKS_VALID
++#define rWork V_rWork
++#define rBranch V_rBranch
++
++#else
++#define rWork I_rWork
++#define rBranch I_rBranch
++#endif
++
++
++#if 0
++#define RED_VAL 0x15
++#define GREEN_VAL 0x2a
++#define BLUE_VAL 0x0a
++#else
++#define RED_VAL 0x0
++#define GREEN_VAL 0x0
++#define BLUE_VAL 0x0
++#endif
++
++//#define BAUDRATE 9600
++//#define BAUDRATE 38400
++//#define BAUDRATE 57600
++//#define BAUDRATE 57600
++#define BAUDRATE 115200
++//#define BAUDRATE 230400
++
++#if (CPU_CLOCK==100)
++#define COUNT_MULT 1
++#else
++#if (CPU_CLOCK==200)
++#define COUNT_MULT 2
++#else
++#if (CPU_CLOCK==300)
++#define COUNT_MULT 3
++#else
++#define COUNT_MULT 4
++#endif
++#endif
++#endif
++
++#if 1 //(SOFTWARE_TYPE==WINCE)
++#define RECEIVE_LOOP_COUNT 0x10000*COUNT_MULT
++#else
++#if (PLATFORM_TYPE==GAME_CONTROLLER_PLAITED_A1)||(PLATFORM_TYPE==GAME_CONTROLLER)||(PLATFORM_TYPE==GAME_WITH_SMC)
++#define RECEIVE_LOOP_COUNT 0x100000*COUNT_MULT
++#else
++#define RECEIVE_LOOP_COUNT 0x300000*3*COUNT_MULT
++#endif
++#endif
++
++// **********************************************************
++#define DBG_MAGIC 95 //this allows BigMov sp,DEBUG_BASE+DBG_MAGIC to generate just 1 instruction
++//#define DBG_START -95
++#define DBG_START 0
++#define DBG_R0 ((0<<2)+DBG_START)
++#define DBG_R1 ((1<<2)+DBG_START)
++#define DBG_R2 ((2<<2)+DBG_START)
++#define DBG_R3 ((3<<2)+DBG_START)
++#define DBG_R4 ((4<<2)+DBG_START)
++#define DBG_R5 ((5<<2)+DBG_START)
++#define DBG_R6 ((6<<2)+DBG_START)
++#define DBG_R7 ((7<<2)+DBG_START)
++#define DBG_R8 ((8<<2)+DBG_START)
++#define DBG_R9 ((9<<2)+DBG_START)
++#define DBG_SL ((10<<2)+DBG_START)
++#define DBG_FP ((11<<2)+DBG_START)
++#define DBG_IP ((12<<2)+DBG_START)
++#define DBG_SP ((13<<2)+DBG_START)
++#define DBG_LR ((14<<2)+DBG_START)
++#define DBG_PC ((15<<2)+DBG_START)
++#define DBG_CPSR ((16<<2)+DBG_START) //this and above have corresponding symbol #s
++
++#define DBG_HCPSR ((17<<2)+DBG_START) //interrupt handler original CPSR
++#define DBG_TRACE ((18<<2)+DBG_START)
++#define DBG_LastSignal ((19<<2)+DBG_START) //only 1 byte
++#define DBG_Mode (((19<<2)+1)+DBG_START) //only 1 byte, bit 0 -1 means gdb mode for control breaks
++#define DBG_FFUART_LCR (((19<<2)+2)+DBG_START) //only 1 byte
++#define DBG_HSP ((20<<2)+DBG_START) //handler stack pointer on entry, for aborts
++#define DBG_TEMP ((21<<2)+DBG_START)
++//22 free
++#define DBG_ABORT_PC ((23<<2)+DBG_START)
++#define DBG_INDIRECT_R0 ((24<<2)+DBG_START) //it needs it's own space in case a debug interrupt
++#define DBG_INDIRECT_LR ((25<<2)+DBG_START) //happens in the return code, but memory is mapped if used
++#define DEBUG_SPACE (((23<<2)|0x1f)+1) //a multiple of 32 bytes
++
++// *********************************************************
++
++#define DEBUG_START (VMA_DEBUG+0x3000-DEBUG_SPACE) //this saves on memory, but the else is easier to debug
++#define VMA_DEBUG_OFFSET (0xffff0000-VMA_DEBUG)
++#define DEBUG_BASE (DEBUG_START-DBG_START)
++#define DEBUG_SYM DEBUG_START
++
++
++#define SYM_R0 0
++#define SYM_R1 1
++#define SYM_R2 2
++#define SYM_R3 3
++#define SYM_R4 4
++#define SYM_R5 5
++#define SYM_R6 6
++#define SYM_R7 7
++#define SYM_R8 8
++#define SYM_R9 9
++#define SYM_SL 10
++#define SYM_FP 11
++#define SYM_IP 12
++#define SYM_SP 13
++#define SYM_LR 14
++#define SYM_PC 15
++#define SYM_CPSR 16
++
++//#define SYM_SPSR 17 //nice to have, but do it later
++//#define SYM_FPS 17
++#define SYM_FP0 17 //40 bits, 5
++#define SYM_FSR 18
++#define SYM_FAR 19
++#define SYM_DCSR 20
++#define SYM_TTBR 21
++#define SYM_CTRL 22
++
++#define SYM_LAST 22
++
++#define SYM_LAST_RCMD (SYM_FP0) //last symbol printed by R cmd
++
++
++
++#define SIG_RESET 0
++#define SIG_UNDEFINED_INSTRUCTION 1
++#define SIG_SWI 2
++#define SIG_PREFETCH_ABORT 3
++#define SIG_DATA_ABORT 4
++#define SIG_UNUSED 5
++#define SIG_IRQ 6
++#define SIG_FIQ 7
++#define SIG_DBG 8
++#define SIG_DBG_RESET 8+0
++#define SIG_DBG_INSTRUCTION_BKPT 8+1
++#define SIG_DBG_DATA_BKPT 8+2
++#define SIG_DBG_BKPT_SOFTWARE 8+3
++#define SIG_DBG_EXTERNAL 8+4
++#define SIG_DBG_VECTOR_TRAP 8+5
++#define SIG_DBG_TRACE_BUFFER_FULL 8+6
++#define SIG_DBG_RESERVED 8+7
++
++#define GDB_EXIT_CHAR 0x0d
++// ******************************************************************
++#define rFieldStart r4
++#define rField r5
++#define rValidCnt r6
++#define rCommand r7
++#define rNum1 r8
++#define rNum2 r9
++#define rSymbol sl //r10
++#define rPrevNum1 fp //r11
++#define rUart ip //r12
++#define rDBG sp
++
++//in Go routine, temporary
++#define rBCR0 sl //r10
++#define rBCR1 fp //r11
++
++//in GDB routines
++#define rGdbCmd r5
++#define rGdbNum1 r6
++#define rGdbTermChar1 r7
++#define rGdbNum2 r8
++#define rGdbTermChar2 r9
++#define rGdbNum3 sl //r10
++#define rGdbChkSum fp //r11
++
++//in Download routine
++#define rDest r3
++#define rPacketLength r4
++#define rDestHead r5
++#define rBlockNum r6
++#define rNak r7
++#define rCRC r8
++#define rRunningCRC r9
++#define rPrevCRC sl //r10
++
++#define rSP r8 //register which contains L4(' ',' ',' ',' '), all spaces
++// ********
++
++#define CR 0x0d
++#define LF 0x0a
++
++// ******************************
++#define F_INC 4
++
++#define F_NUM1_BIT (F_INC*3)
++#define F_NUM2_BIT (F_INC*5)
++
++#define F_COMMAND 1<<(F_INC)
++#define F_NUM1 1<<(F_NUM1_BIT)
++#define F_NUM2 1<<(F_NUM2_BIT)
++#define F_UNDEF 1<<(F_INC*7)
++
++#define F_COMMAND_MASK ((1<<F_INC)-1)<<(F_INC)
++#define F_NUM1_MASK ((1<<F_INC)-1)<<(F_INC*3)
++#define F_NUM2_MASK ((1<<F_INC)-1)<<(F_INC*5)
++// ******************************
++#define cachelinecount 2048 //1024 if baseaddress not used for another purpose
++#define cachelinesize 32
++//#define baseaddress 0 //physical memory does not have to exist here, but a valid descriptor table entry IS required
++
++// *****************************
++#define SOH 1
++#define STX 2
++#define EOT 4
++#define ACK 6
++#define NAK 0x15
++#define CAN 0x18
++
++#define CRC_POLY 0x10210000
++// *****************************
++
++// divide 0x1000 bytes among the stacks
++#define SS_SUPERVISOR 0x0800
++#define SS_IRQ 0x0400
++#define SS_FIQ 0x0100
++#define SS_SYSTEM 0x0100
++#define SS_UNDEFINED 0x0100
++#define SS_ABORT 0x0100
++#define SS_TOTAL (SS_SUPERVISOR+SS_IRQ+SS_FIQ+SS_SYSTEM+SS_UNDEFINED+SS_ABORT)
++#define SS_START 0x0a0008000-0x4400-SS_TOTAL //-17k, 16k for 1st level page table, 1k for 2nd level page table
++// *****************************
++
++
++
++
++// *********************************
++.macro mac_AfterPCPrint branch //vector table at 0xffff0000, br to vector table at VMA_DEBUG
++ .ifdef __ARMASM
++ LCLA cnt
++ .set cnt,$branch
++ WHILE cnt>0
++ b 93f
++ .set cnt,cnt-1
++ WEND
++ .else
++ .rept (\branch)
++ b 93f
++ .endr
++ .endif
++
++AfterPCPrint:
++ mov r0,#0x55
++ b AfterPCPrint1
++InitializeCont:
++ b MainInitializationCode
++93:
++.endm
++
++
++.macro RelocationVector branch //vector table at 0xffff0000, br to vector table at VMA_DEBUG
++ //warning, do not use relocated vectors unless memory management is enabled and VMA_DEBUG is mapped
++ .ifdef __ARMASM
++ LCLA cnt
++ .set cnt,$branch
++ WHILE cnt>0
++ b 71f
++ .set cnt,cnt-1
++ WEND
++ .else
++ .rept (\branch)
++ b 71f
++ .endr
++ .endif
++
++ mov pc,#0x00 //0 - reset always goes to 0 because it will be in physical memory mode for instructions
++ b .-VMA_DEBUG_OFFSET //4 - UndefinedInstr
++ b .-VMA_DEBUG_OFFSET //8 - SWI
++ b .-VMA_DEBUG_OFFSET //0x0c - PrefetchAbort
++ b .-VMA_DEBUG_OFFSET //0x10 - DataAbort
++ b .-VMA_DEBUG_OFFSET //0x14 - Unused
++ b .-VMA_DEBUG_OFFSET //0x18 - IRQ
++ .if SUB_LR_FALL_THRU_FOR_FIQ
++ sub lr,lr,#4 //0x1c - FIQ
++ .else
++ b .-VMA_DEBUG_OFFSET //0x1c - FIQ
++ .endif
++
++//these instructions are always at this address
++//to minimize the effect of a mismatch of minicache and flash
++ReturnWithIndirection:
++ mov r0,r0 //!!!! make sure this instruction is in the 1st 4k of flash so that BigOrr2Ne is guaranteed to work
++ ldr pc,[sp],#4
++
++//c-0 invalidate caches, c-1 skip cache invalidate
++//z-1 return direct, z-0 return indirect
++InvalidateAndReturn:
++ adrne lr,ReturnWithIndirection
++ ldreq lr,[r0,#DBG_PC-DBG_R2]
++ BigOrr2Ne lr,VMA_DEBUG //this range is sure to give an external abort for errata on exiting SDS
++
++//Invalidate the data/instruction cache and branch target buffer
++
++ CP15_CF_INVAL_BOTH mcrcc,r1
++ CPWAIT r1
++
++ ldr sp,[r0,#DBG_HSP-DBG_R2]
++ ldr r1,[r0,#DBG_R1-DBG_R2]
++ str r0,[r0,#DBG_ABORT_PC-DBG_R2] //reset error flag so abort can be retried
++ ldr r0,[r0,#DBG_R0-DBG_R2]
++ movs pc,lr
++71:
++.endm
++
++.macro CheckBranch rTemp,rAddr
++ movs \rTemp,pc //don't redirect if running from flash
++ submi \rAddr, \rAddr, #0x00010000
++ ldrmi \rTemp, [\rAddr], #8
++ eormi \rTemp, \rTemp, #0xea000000
++ tstmi \rTemp, #0xff000000
++ moveq \rTemp, \rTemp, LSL #8
++ addeq \rAddr, \rAddr, \rTemp, ASR #6
++.endm
++.macro CheckLdr rTemp,rAddr //check for instruction LDR pc,[pc,#nnn]
++ eor \rTemp, \rTemp, #0x0f900000
++ eor \rTemp, \rTemp, #0x000ff000
++ cmp \rTemp, #0x1000
++ ldrcc \rAddr,[\rAddr,\rTemp]
++.endm
++
++//this is case where stacks are assumed valid
++.macro V_VectorEntrance Work,Branch,code
++ stmdb sp!,{\Work,\Branch,lr}
++ mov \Branch,#\code<<2
++.endm
++.macro V_VectorExitCC Work,Branch,cc,ccia
++ str\cc \Branch,[sp,#8]
++ ldm\ccia sp!,{\Work,\Branch,pc}
++.endm
++.macro V_VectorExitCC1 Work,Branch,cc,ccia
++ str\cc \Branch,[sp,#8]
++ ldm\ccia sp!,{\Work,\Branch,pc}
++.endm
++
++//this is case where stacks are assumed invalid
++.macro I_VectorEntrance Work,Branch,code
++ BigMov \Branch,DEBUG_BASE+DBG_MAGIC
++ str \Work,[\Branch,#DBG_TEMP-DBG_MAGIC]
++ mov \Branch, #\code<<2
++.endm
++.macro I_VectorExitCC Work,Branch,cc,ccia
++ BigMovCC \cc,\Work,DEBUG_BASE+DBG_MAGIC
++ ldr\cc \Work,[\Work,#DBG_TEMP-DBG_MAGIC]
++ bx\cc \Branch
++.endm
++.macro I_VectorExitCC1 Work,Branch,cc,ccia
++ BigMov \Work,DEBUG_BASE+DBG_MAGIC
++ ldr\cc \Work,[\Work,#DBG_TEMP-DBG_MAGIC]
++ bx\cc \Branch
++.endm
++.macro VectorEntrance Work,Branch,code
++ .if STACKS_VALID
++ V_VectorEntrance \Work,\Branch,\code
++ .else
++ I_VectorEntrance \Work,\Branch,\code
++ .endif
++.endm
++.macro JOIN brcc
++ .if STACKS_VALID
++ \brcc join_fiq
++ .else
++ \brcc join_irq
++ .endif
++.endm
++.macro JOIN2 brcc
++ .if STACKS_VALID
++ \brcc join_fiq2
++ .else
++ \brcc join_irq2
++ .endif
++.endm
++// *****************************************************
++
++.macro SaveRegisters rBase,rTemp
++ CalcMemSize \rBase,\rTemp,MEMORY_CONTROL_BASE //out: \rTemp - mem size
++ BigAdd \rBase,\rTemp,MEM_START-0x1000+((DEBUG_BASE+DBG_MAGIC)&0xfff) //last 4k of memory
++ mov \rTemp,#0
++//great, now memory should be working, let's save registers, only r0(rBase),sp(rTemp) have been lost
++//don't trust LDM,STM instructions in debug mode....
++//or LDR w/Rd=PC, LDR w/RRX addressing mode, SWP, LDC, STC
++// *******************************************************
++// *******************************************************
++ str \rTemp,[\rBase,#DBG_START-32 -DBG_MAGIC]
++ str \rTemp,[\rBase,#DBG_R0 -DBG_MAGIC]
++ str r1, [\rBase,#DBG_R1 -DBG_MAGIC]
++ str r2, [\rBase,#DBG_R2 -DBG_MAGIC]
++ str r3, [\rBase,#DBG_R3 -DBG_MAGIC]
++ str \rTemp,[\rBase,#DBG_TRACE -DBG_MAGIC]
++ str \rTemp,[\rBase,#DBG_LastSignal-DBG_MAGIC]
++.endm
++.macro ReadHexE dest,rCnt1
++
++#if LITTLE_ENDIAN
++ mov \rCnt1,#4
++ mov \dest,#0
++1: bl ReadHex
++ bcc CheckSumError
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ mov r1,r1,LSL #28
++ add \dest,r1,\dest,LSR #8
++
++ bl ReadHex
++ bcc CheckSumError
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ add \dest,\dest,r1,LSL #24
++#else
++ mov \rCnt1,#8
++ mov \dest,#0
++1: bl ReadHex
++ bcc CheckSumError
++ add rGdbChkSum,rGdbChkSum,r0 //update checksum
++ add \dest,r1,\dest,LSL #4
++#endif
++ subs \rCnt1,\rCnt1,#1
++ bne 1b
++.endm
++
++
++
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/mmc.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/mmc.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/mmc.h 2003-06-27 23:32:42.000000000 +0200
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/mmc.h 2007-08-11 21:07:21.000000000 +0200
+@@ -4,7 +4,7 @@
+ * Author: Vladimir Shebordaev, Igor Oblakov
+ * Copyright: MontaVista Software Inc.
+ *
+- * $Id: mmc_pxa.h,v 0.3.1.6 2002/09/25 19:25:48 ted Exp ted $
++ * $Id: mmc.h,v 1.3 2005/04/16 17:05:19 ericn Exp $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+@@ -113,12 +113,17 @@
+ #define MMC_CMD_SET_RCA 3
+ #define MMC_CMD_SEND_CSD 9
+ #define MMC_CMD_SEND_CID 10
++#define MMC_CMD_STOP 12
+ #define MMC_CMD_SEND_STATUS 13
+ #define MMC_CMD_SET_BLOCKLEN 16
+ #define MMC_CMD_READ_BLOCK 17
+ #define MMC_CMD_RD_BLK_MULTI 18
+ #define MMC_CMD_WRITE_BLOCK 24
+
++#define SD_APP_CMD55 55 /* 0x37 */
++#define SD_APP_CMD41 41 /* 0x29 */
++#define SD_STATUS 13 /* 0x0D */
++
+ #define MMC_MAX_BLOCK_SIZE 512
+
+ #define MMC_R1_IDLE_STATE 0x01
+@@ -197,4 +202,15 @@
+ } mmc_csd_t;
+
+
++typedef struct sd_status {
++ ulong prot_size ;
++ ushort card_type ;
++ ushort bus_width:2,
++ secured_mode:1,
++ unused0: 13 ;
++} sd_status_t ;
++
++extern uchar *
++mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat);
++
+ #endif /* __MMC_PXA_P_H__ */
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/platformTypes.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/platformTypes.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/platformTypes.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/platformTypes.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,19 @@
++#ifndef __PLATFORMTYPES_H__
++#define __PLATFORMTYPES_H__ 1
++#define NEON 1
++#define NEONB 2
++#define BD2003 3
++#define GAME_WITH_SMC 4
++#define GAME_CONTROLLER 5
++#define GAME_CONTROLLER_PLAITED_A1 6
++#define BOUNDARY_OLD_BOARD 7 //lcd pin reordering for rgb problem, don't use VLIO(gp18 is turnstile)
++#define OLD_GAME_CONTROLLER 8
++#define HALOGEN 9
++
++#if (PLATFORM_TYPE==NEONB)
++#define PHYS_FLASH_BASE 0x04000000
++#else
++#define PHYS_FLASH_BASE 0x0
++#endif
++
++#endif
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxa250Base.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxa250Base.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxa250Base.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxa250Base.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,60 @@
++#ifndef __PXA250BASE_H__
++#define __PXA250BASE_H__ 1
++
++#ifdef __ARMASM
++#define USE_PHYSICAL 1
++#else
++#ifndef _MSC_VER
++#define USE_PHYSICAL 1
++#endif
++#endif
++
++
++#ifndef USE_PHYSICAL
++#if EBOOT_PHYS
++#define USE_PHYSICAL 1
++#endif
++#endif
++
++#if USE_PHYSICAL
++#define PCMCIA_CARD0_IO 0x20000000
++#define PCMCIA_CARD0_ATTR 0x28000000
++#define PCMCIA_CARD0_MEM 0x2c000000
++
++#define PCMCIA_CARD1_IO 0x30000000
++#define PCMCIA_CARD1_ATTR 0x38000000
++#define PCMCIA_CARD1_MEM 0x3c000000
++
++#define FFUART_BASE 0x40100000
++#define BTUART_BASE 0x40200000
++#define STUART_BASE 0x40700000
++#define UART_BASE FFUART_BASE
++//#define UART_BASE BTUART_BASE
++
++#define OS_TIMER_BASE 0x40a00000
++#define IC_BASE 0x40D00000
++#define GPIO_BASE 0x40E00000
++#define PWR_MANAGER_BASE 0x40F00000
++#define CLK_MANAGER_BASE 0x41300000
++#define LCD_CONTROL_BASE 0x44000000
++#define MEMORY_CONTROL_BASE 0x48000000
++
++#define MEM_START 0xa0000000
++
++
++#else
++#include "xsc1.h"
++
++#define PCMCIA_CARD0_IO PCMCIA_S0_IO_U_VIRTUAL
++#define PCMCIA_CARD0_ATTR PCMCIA_S0_ATTR_U_VIRTUAL
++#define PCMCIA_CARD0_MEM PCMCIA_S0_CMN_U_VIRTUAL
++
++#define PCMCIA_CARD1_IO PCMCIA_S1_IO_U_VIRTUAL
++#define PCMCIA_CARD1_ATTR PCMCIA_S1_ATTR_U_VIRTUAL
++#define PCMCIA_CARD1_MEM PCMCIA_S0_CMN_U_VIRTUAL
++
++#define MEMORY_CONTROL_BASE MEMC_BASE_U_VIRTUAL
++#define GPIO_BASE GPIO_BASE_U_VIRTUAL
++#endif
++
++#endif
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio25x.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio25x.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio25x.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio25x.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,218 @@
++//gpios for PLATFORM_TYPE== NEON,NEONB,BD2003, or BOUNDARY_OLD_BOARD
++
++#define LCD_CS_STATE HIGH
++
++//CP - Clock and Power Management Unit
++//MMC - Multimedia Card Controller
++//MC - Memory Controller
++//SIU - System Integration Unit
++//SSP - Synchronous Serial Port
++//AC - Audio Controller (AC97)
++//FF - Full Function UART
++//BT - Blue Tooth UART
++//ST - standard UART Port
++//LCD - LCD Controller
++ SPEC_GP 0,IN,HIGH,0 // flash ready low 16, or magStripe T1 Clk(SMC)
++ SPEC_GP 1,IN,HIGH,0 //CP_RST, flash ready high 16, or magStripe T2 Clk(SMC)
++
++#if (PLATFORM_TYPE==NEONB)
++ SPEC_GP 2,IN,HIGH,0 //USB client connection status
++ SPEC_GP 3,IN,HIGH,0 //float means USB Slave not ready to accept data
++ //out 1 means ready (D+ signal)
++ SPEC_GP 4,OUT,LOW,0 //low means don't provide 12 volts to I2C bus
++#else
++#if (PLATFORM_TYPE==NEON)
++ SPEC_GP 2,IN,HIGH,0 //USB client connection status
++ SPEC_GP 3,IN,HIGH,0 //float means USB Slave not ready to accept data
++ SPEC_GP 4,IN,HIGH,0 //UCB1400 irq on NEON board
++#else
++ SPEC_GP 2,OUT,LOW,0 //output to transistor (unused), OUT_DRY_CONTACT2
++ SPEC_GP 3,OUT,HIGH,0
++ SPEC_GP 4,IN,HIGH,0 //interrupt for USB irq 1
++#endif
++#endif
++
++ SPEC_GP 5,IN,HIGH,0 //interrupt for USB irq 2, or SM501
++ SPEC_GP 6,OUT,HIGH,1 //MMC_CLK
++ SPEC_GP 7,OUT,LOW,0 //CP_48MHZ !!! red led, NEON:J13,pin3
++ SPEC_GP 8,OUT,HIGH,1 //MMC_CCS0
++ SPEC_GP 9,OUT,LOW,0 //MMC_CCS1, !!! doorlock, or OUT_DRY_CONTACT1
++ SPEC_GP 10,IN,HIGH,0 //SIU_RTCCLK, Neon/Neonb data 1 for SDIO interrupt
++
++#if (PLATFORM_TYPE==NEON)
++ SPEC_GP 11,OUT,HIGH,0 //CP_3600KHZ, NEON:J12,pin1
++#else
++ SPEC_GP 11,IN,HIGH,0 //CP_3600KHZ, suspend USB slave
++#endif
++ SPEC_GP 12,IN,HIGH,0 //CP_32KHZ, suspend USB host
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 13,OUT,HIGH,2 //MC_MBGNT
++ SPEC_GP 14,IN,HIGH,1 //MC_MBREQ
++#else
++ SPEC_GP 13,OUT,HIGH,0 //USB wakeup slave
++ SPEC_GP 14,IN,HIGH,0 //UCB1400 IRQ
++#endif
++
++
++#if (PLATFORM_TYPE==NEONB)
++ SPEC_GP 15,OUT,HIGH,2 //MC_nCS1, eeprom
++#else
++#if (PLATFORM_TYPE==NEON)
++ SPEC_GP 15,OUT,LOW,0 //MC_nCS1, NEON:J13, pin 1
++#else
++ SPEC_GP 15,OUT,LOW,0 //MC_nCS1, !!! amber led
++#endif
++#endif
++
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 16,OUT,HIGH,0 //LCD backlight brightness control
++ SPEC_GP 17,OUT,HIGH,0 //LCD backlight ON/OFF
++#else
++ SPEC_GP 16,IN,HIGH,0 //SIU_PWM0, !!! feedback2, left in
++ SPEC_GP 17,IN,HIGH,0 //SIU_PWM1, !!! feedback1, right in
++#endif
++
++#if (PLATFORM_TYPE==BOUNDARY_OLD_BOARD)
++ SPEC_GP 18,OUT,HIGH,0 //MC_RDY, !!! turnstile
++#else
++ SPEC_GP 18,IN,HIGH,1 //MC_RDY, VIO_READY
++#endif
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 19,OUT,HIGH,0 //MC_DREQ1, nc
++#else
++ SPEC_GP 19,IN,HIGH,1 //MC_DREQ1, DMA request for USB DC
++#endif
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 20,OUT,HIGH,1 //MC_DREQ0, nc
++#else
++ SPEC_GP 20,IN,HIGH,1 //MC_DREQ0, DMA request for USB HC
++#endif
++
++ SPEC_GP 21,IN,HIGH,0 // pcmcia card detect
++ SPEC_GP 22,IN,HIGH,0 // pcmcia intr (active low)
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 23,IN,LOW,0 //UCB1400 irq for NEONB, nc for NEW NEON
++#else
++ SPEC_GP 23,OUT,HIGH,0 //SSP_SCLK, nc
++#endif
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++ SPEC_GP 24,IN,LOW,0 //SSP_SFRM, SMSC interrupt (active high)
++#else
++ SPEC_GP 24,OUT,HIGH,0 //SSP_SFRM, nc
++#endif
++
++ SPEC_GP 25,OUT,HIGH,0 //SSP_TXD, nc
++ SPEC_GP 26,OUT,HIGH,0 //SSP_RXD, nc
++ SPEC_GP 27,OUT,LOW,0 //SSP_EXTCLK, DC1 (SMC)
++
++ SPEC_GP 28,IN,HIGH,1 //AC_BITCLK, ac97 bitclk
++ SPEC_GP 29,IN,HIGH,1 //AC_SDATAIN0, ac97 datain0
++ SPEC_GP 30,OUT,HIGH,2 //AC_SDATAOUT, ac97 data out
++ SPEC_GP 31,OUT,HIGH,2 //AC_SYNC, ac97 sync
++////////////////////////////////////////////////////////////////////////////////////////////
++
++
++ SPEC_GP 32,OUT,HIGH,0 //AC_SDATAIN1, wet contact
++ SPEC_GP 33,OUT,LOW,0 //MC_nCS5, green led (left), NEON:J13,pin 2
++ SPEC_GP 34,IN,HIGH,1 //FF_RXD
++ SPEC_GP 35,IN,HIGH,1 //FF_CTS
++ SPEC_GP 36,IN,HIGH,0 //FF_DCD, MMC Card Detect
++ SPEC_GP 37,IN,HIGH,1 //FF_DSR
++ SPEC_GP 38,IN,HIGH,0 //FF_RI, MMC Write Protect, MMC/SDIO IRQ
++ SPEC_GP 39,OUT,HIGH,2 //FF_TXD
++ SPEC_GP 40,OUT,HIGH,2 //FF_DTR
++ SPEC_GP 41,OUT,HIGH,2 //FF_RTS
++ SPEC_GP 42,IN,HIGH,1 //BT_RXD
++ SPEC_GP 43,OUT,HIGH,2 //BT_TXD
++#if (PLATFORM_TYPE==NEON)
++ SPEC_GP 44,IN,HIGH,0 //BT_CTS, NEON:J12,pin 2
++#else
++ SPEC_GP 44,OUT,HIGH,0 //BT_CTS, USB wakeup host
++#endif
++ SPEC_GP 45,OUT,LOW,0 //BT_RTS, HIGH 2
++#if (PLATFORM_TYPE==NEON)
++ SPEC_GP 46,IN,HIGH,0 //ST_RXD, NEON:J12,pin 3
++#else
++ SPEC_GP 46,IN,HIGH,2 //ST_RXD
++#endif
++ SPEC_GP 47,OUT,HIGH,1 //ST_TXD
++ SPEC_GP 48,OUT,HIGH,2 //MC_nPOE, pcmcia
++ SPEC_GP 49,OUT,HIGH,2 //MC_nPWE, pcmcia
++ SPEC_GP 50,OUT,HIGH,2 //MC_nPIOR, pcmcia
++ SPEC_GP 51,OUT,HIGH,2 //MC_nPIOW, pcmcia
++ SPEC_GP 52,OUT,HIGH,2 //MC_nPCE1, pcmcia
++ SPEC_GP 53,OUT,HIGH,2 //MC_nPCE2, pcmcia
++ SPEC_GP 54,OUT,HIGH,2 //MC_nPSKTSEL, nc
++ SPEC_GP 55,OUT,HIGH,2 //MC_nPREG, pcmcia attribe vs Io space
++ SPEC_GP 56,IN,HIGH,1 //MC_nPWAIT pcmcia busy
++ SPEC_GP 57,IN,HIGH,1 //MC_nIOIS16, pcmcia 16 bit wide
++ SPEC_GP 58,OUT,HIGH,ALT_LCD //LCD_LDD0, also GP_PIX_D0
++ SPEC_GP 59,OUT,HIGH,ALT_LCD //LCD_LDD1, also GP_PIX_D1
++ SPEC_GP 60,OUT,HIGH,ALT_LCD //LCD_LDD2, also GP_PIX_D2
++ SPEC_GP 61,OUT,HIGH,ALT_LCD //LCD_LDD3, also GP_PIX_D3
++ SPEC_GP 62,OUT,HIGH,ALT_LCD //LCD_LDD4, also GP_PIX_D4
++ SPEC_GP 63,OUT,HIGH,ALT_LCD //LCD_LDD5, also GP_PIX_D5
++
++
++////////////////////////////////////////////////////////////////////////////////////////////
++
++
++ SPEC_GP 64,OUT,HIGH,ALT_LCD //LCD_LDD6, also GP_PIX_D6
++ SPEC_GP 65,OUT,HIGH,ALT_LCD //LCD_LDD7, also GP_PIX_D7
++ SPEC_GP 66,OUT,HIGH,ALT_LCD //LCD_LDD8, also GP_PIX_RESET
++ SPEC_GP 67,OUT,HIGH,ALT_LCD //LCD_LDD9
++ SPEC_GP 68,OUT,HIGH,ALT_LCD //LCD_LDD10
++ SPEC_GP 69,OUT,HIGH,ALT_LCD //LCD_LDD11
++ SPEC_GP 70,OUT,HIGH,ALT_LCD //LCD_LDD12
++
++ SPEC_GP 71,OUT,HIGH,ALT_LCD //LCD_LDD13
++
++ SPEC_GP 72,OUT,HIGH,ALT_LCD //LCD_LDD14
++ SPEC_GP 73,OUT,HIGH,ALT_LCD //LCD_LDD15
++ SPEC_GP 74,OUT,HIGH,ALT_LCD //LCD_FCLK, also GP_PIX_READ
++ SPEC_GP 75,OUT,LCD_CS_STATE,ALT_LCD //LCD_LCLK, also GP_PIX_CS1
++ SPEC_GP 76,OUT,LCD_CS_STATE,ALT_LCD //LCD_PCLK, also GP_PIX_CS0
++ SPEC_GP 77,OUT,HIGH,ALT_LCD //LCD_ACBIAS, also GP_PIX_A0
++ SPEC_GP 78,OUT,HIGH,2 //nCS2, DMA acknowledge channel 1 for USB, SMC91c111 Chip Select nDATACS
++ SPEC_GP 79,OUT,HIGH,2 //nCS3, DMA acknowledge channel 2 for USB, SM501 Chip Select
++ SPEC_GP 80,OUT,HIGH,2 //nCS4, USB chip select, SMC91c111 Chip Select
++ SPEC_GP 81,IN,LOW,0 //GND (pin F16), pxa255 has 9 extra gpios
++ SPEC_GP 82,IN,LOW,0 //GND (pin E16)
++ SPEC_GP 83,IN,LOW,0 //GND (pin E15)
++ SPEC_GP 84,IN,LOW,0 //GND (pin D16)
++ SPEC_GP 85,IN,LOW,0 //GND (pin F15)
++//to maintain compatibility with code written for the pxa250
++//the meaning of gp86-gp89's direction bit is reversed, and alternate function is forced to the SDRAM/AC97 unit's control
++ SPEC_GP 86,IN,HIGH,0 //SDCS2 (pin G3) set as OUTPUT!!!
++ SPEC_GP 87,IN,HIGH,0 //SDCS3 (pin F2) set as OUTPUT!!!
++ SPEC_GP 88,IN,HIGH,0 //old RDnWR(pin D3) set as OUTPUT!!!
++ SPEC_GP 89,IN,LOW,0 //old ac97_reset(pin D10), set as OUTPUT!!!
++ SPEC_GP 90,IN,LOW,0 //undefined
++ SPEC_GP 91,IN,LOW,0 //undefined
++ SPEC_GP 92,IN,LOW,0 //undefined
++ SPEC_GP 93,IN,LOW,0 //undefined
++ SPEC_GP 94,IN,LOW,0 //undefined
++ SPEC_GP 95,IN,LOW,0 //undefined
++
++// ****************************************************************************
++ CREATE_MASK_DIR DRVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++ CREATE_MASK_LEVEL SRVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++ CREATE_MASK_ALT AFVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
++ CREATE_MASK_ALT AFVAL16,SPEC_,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++
++ CREATE_MASK_DIR DRVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++ CREATE_MASK_LEVEL SRVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++ CREATE_MASK_ALT AFVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
++ CREATE_MASK_ALT AFVAL48,SPEC_,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++
++ CREATE_MASK_DIR DRVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++ CREATE_MASK_LEVEL SRVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++ CREATE_MASK_ALT AFVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
++ CREATE_MASK_ALT AFVAL80,SPEC_,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio27x.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio27x.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio27x.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio27x.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,221 @@
++//gpios for HALOGEN
++
++//CP - Clock and Power Management Unit
++//MMC - Multimedia Card Controller
++//MC - Memory Controller
++//SIU - System Integration Unit
++//SSP - Synchronous Serial Port
++//AC - Audio Controller (AC97)
++//FF - Full Function UART
++//BT - Blue Tooth UART
++//ST - standard UART Port
++//LCD - LCD Controller
++
++ SPEC_GP 0,IN,HIGH,0 //
++ SPEC_GP 1,IN,HIGH,0 //nRESET_GPIO, usb client connect interrupt
++
++ SPEC_GP 2,IN,HIGH,0 //SYS_EN
++
++ SPEC_GP 3,IN,HIGH,0 //PWR_SCL, Rev 1 usb client enable, float means USB Slave not ready to accept data
++ //out 1 means ready
++
++ SPEC_GP 4,IN,HIGH,0 //PWR_SDA
++
++ SPEC_GP 5,IN,HIGH,0 //PWR_CAP 0
++ SPEC_GP 6,IN,HIGH,0 //PWR_CAP 1
++ SPEC_GP 7,IN,HIGH,0 //PWR_CAP 2
++ SPEC_GP 8,IN,HIGH,0 //PWR_CAP 3
++ SPEC_GP 9,OUT,HIGH,0 //NC
++#if (PLATFORM_REV==1)
++ SPEC_GP 10,OUT,HIGH,0 //NC, rev 1 doesn't have MMC write protect, or card detect
++#else
++ SPEC_GP 10,IN,HIGH,0 //MMC card detect
++#endif
++
++ SPEC_GP 11,OUT,HIGH,0 //NC
++ SPEC_GP 12,OUT,HIGH,0 //NC
++ SPEC_GP 13,OUT,HIGH,0 //NC
++
++ SPEC_GP 14,OUT,HIGH,0 //NC
++ SPEC_GP 15,OUT,HIGH,2 //nCS1, NC
++
++
++ SPEC_GP 16,OUT,LOW,0 //PWM0 backlight intensity, 0 brightest
++ SPEC_GP 17,OUT,HIGH,0 //NC
++
++ SPEC_GP 18,IN,HIGH,1 //MC_RDY, VIO_READY
++
++ SPEC_GP 19,OUT,HIGH,0 //NC
++
++ SPEC_GP 20,OUT,HIGH,1 //MC_DREQ0, NC
++
++ SPEC_GP 21,OUT,HIGH,0 //NC
++ SPEC_GP 22,OUT,HIGH,0 //NC
++
++#if (PLATFORM_REV==1)
++ SPEC_GP 23,OUT,HIGH,0 //NC
++#else
++ SPEC_GP 23,IN,HIGH,0 //rev 2 UCB1400 int
++#endif
++
++ SPEC_GP 24,IN,LOW,0 //LAN91c111 Interrupt pin (SMSC)
++
++ SPEC_GP 25,OUT,HIGH,0 //SSP_TXD, nc
++ SPEC_GP 26,OUT,HIGH,0 //SSP_RXD, nc
++ SPEC_GP 27,OUT,HIGH,0 //NC
++
++ SPEC_GP 28,IN,HIGH,1 //AC_BITCLK, ac97 bitclk
++ SPEC_GP 29,IN,HIGH,1 //AC_SDATAIN0, ac97 datain0
++ SPEC_GP 30,OUT,HIGH,2 //AC_SDATAOUT, ac97 data out
++ SPEC_GP 31,OUT,HIGH,2 //AC_SYNC, ac97 sync
++////////////////////////////////////////////////////////////////////////////////////////////
++
++
++ SPEC_GP 32,OUT,HIGH,2 //MMCLK
++ SPEC_GP 33,OUT,HIGH,0 //MC_nCS5, NC
++ SPEC_GP 34,IN,HIGH,1 //(in alt 1:FF_RXD) (out alt 1:USB_P2_2) 2 input, Session Valid
++ SPEC_GP 35,IN,HIGH,0 //(in alt 1:FF_CTS) (in alt 2:USB_P2_1) 1 input, SRP Detect
++#if (PLATFORM_REV==1)
++ SPEC_GP 36,OUT,HIGH,0 //(in alt 1:FF_DCD)
++#else
++ SPEC_GP 36,IN,HIGH,0 //(in alt 1:FF_DCD) (out alt 1:USB_P2_4) 4 output Vbus Enable
++#endif
++ SPEC_GP 37,OUT,HIGH,0 //(in alt 1:FF_DSR) (out alt 1:USB_P2_8) 8 output Vbus Pulsing Enable for SRP
++
++ SPEC_GP 38,IN,HIGH,0 //(in alt 1:FF_RI) (in alt 3:USB_P2_3) //MMC Write Protect (rev 1 is NC),// 3 input, Vbus valid 4.4 Volts
++ SPEC_GP 39,OUT,HIGH,2 //(out alt 2:FF_TXD) (out alt 1:USB_P2_6)
++
++#if (PLATFORM_REV==1)
++ SPEC_GP 40,OUT,HIGH,2 //(out alt 2:FF_DTR)
++#else
++ SPEC_GP 40,IN,HIGH,0 //(out alt 2:FF_DTR) (in alt 3:USB_P2_5) 5 input, Vbus valid 4.0 Volts
++#endif
++
++ SPEC_GP 41,OUT,HIGH,2 //(out alt 2:FF_RTS) (in alt 2:USB_P2_7) 7 input OTG ID
++ SPEC_GP 42,IN,HIGH,1 //BT_RXD
++ SPEC_GP 43,OUT,HIGH,2 //BT_TXD
++ SPEC_GP 44,OUT,HIGH,0 //BT_CTS, NC
++ SPEC_GP 45,OUT,LOW,0 //BT_RTS, NC
++ SPEC_GP 46,IN,HIGH,2 //ST_RXD
++ SPEC_GP 47,OUT,HIGH,1 //ST_TXD
++ SPEC_GP 48,OUT,HIGH,2 //MC_nPOE,NC
++ SPEC_GP 49,OUT,HIGH,2 //MC_nPWE
++ SPEC_GP 50,OUT,HIGH,2 //MC_nPIOR, NC
++ SPEC_GP 51,OUT,HIGH,2 //MC_nPIOW, NC
++ SPEC_GP 52,OUT,HIGH,2 //MC_nPCE1, NC
++ SPEC_GP 53,OUT,HIGH,2 //MC_nPCE2, NC
++ SPEC_GP 54,OUT,HIGH,2 //MC_nPSKTSEL, nc
++ SPEC_GP 55,OUT,HIGH,2 //MC_nPREG, NC
++ SPEC_GP 56,IN,HIGH,1 //MC_nPWAIT NC
++ SPEC_GP 57,IN,HIGH,1 //MC_nIOIS16, NC
++ SPEC_GP 58,OUT,HIGH,ALT_LCD //LCD_LDD0
++ SPEC_GP 59,OUT,HIGH,ALT_LCD //LCD_LDD1
++ SPEC_GP 60,OUT,HIGH,ALT_LCD //LCD_LDD2
++ SPEC_GP 61,OUT,HIGH,ALT_LCD //LCD_LDD3
++ SPEC_GP 62,OUT,HIGH,ALT_LCD //LCD_LDD4
++ SPEC_GP 63,OUT,HIGH,ALT_LCD //LCD_LDD5
++
++
++////////////////////////////////////////////////////////////////////////////////////////////
++
++
++ SPEC_GP 64,OUT,HIGH,ALT_LCD //LCD_LDD6
++ SPEC_GP 65,OUT,HIGH,ALT_LCD //LCD_LDD7
++ SPEC_GP 66,OUT,HIGH,ALT_LCD //LCD_LDD8
++ SPEC_GP 67,OUT,HIGH,ALT_LCD //LCD_LDD9
++ SPEC_GP 68,OUT,HIGH,ALT_LCD //LCD_LDD10
++ SPEC_GP 69,OUT,HIGH,ALT_LCD //LCD_LDD11
++ SPEC_GP 70,OUT,HIGH,ALT_LCD //LCD_LDD12
++
++ SPEC_GP 71,OUT,HIGH,ALT_LCD //LCD_LDD13
++
++ SPEC_GP 72,OUT,HIGH,ALT_LCD //LCD_LDD14
++ SPEC_GP 73,OUT,HIGH,ALT_LCD //LCD_LDD15
++ SPEC_GP 74,OUT,HIGH,ALT_LCD //LCD_FCLK, NC
++ SPEC_GP 75,OUT,HIGH,ALT_LCD //LCD_LCLK
++ SPEC_GP 76,OUT,HIGH,ALT_LCD //LCD_PCLK
++ SPEC_GP 77,OUT,HIGH,ALT_LCD //LCD_ACBIAS
++ SPEC_GP 78,OUT,HIGH,2 //nCS2, SMC91c111 Chip Select nDATACS
++ SPEC_GP 79,OUT,HIGH,2 //nCS3, NC
++ SPEC_GP 80,OUT,HIGH,2 //nCS4, SMC91c111 Chip Select
++ SPEC_GP 81,OUT,HIGH,0 //NC
++ SPEC_GP 82,OUT,HIGH,0 //NC
++ SPEC_GP 83,OUT,HIGH,0 //NC
++ SPEC_GP 84,OUT,HIGH,0 //NC
++ SPEC_GP 85,OUT,HIGH,0 //NC
++ SPEC_GP 86,OUT,HIGH,ALT_LCD //LDD16
++ SPEC_GP 87,OUT,HIGH,ALT_LCD //LDD17
++#if (PLATFORM_REV==1)
++ SPEC_GP 88,OUT,HIGH,0 //NC
++ SPEC_GP 89,OUT,HIGH,0 //NC
++#else
++ SPEC_GP 88,IN,HIGH,1 //port 1 usb power over current
++ SPEC_GP 89,OUT,HIGH,0 //port 1 usb power enable (driver needs to enable usb power (LOW,2)
++#endif
++
++ SPEC_GP 90,OUT,HIGH,0 //NC
++ SPEC_GP 91,OUT,HIGH,0 //NC
++ SPEC_GP 92,OUT,HIGH,1 //MMDAT
++ SPEC_GP 93,OUT,HIGH,0 //NC
++ SPEC_GP 94,OUT,HIGH,0 //NC
++ SPEC_GP 95,OUT,HIGH,0 //NC
++ SPEC_GP 96,OUT,HIGH,0 //NC
++ SPEC_GP 97,OUT,HIGH,0 //NC
++ SPEC_GP 98,OUT,HIGH,0 //NC
++ SPEC_GP 99,OUT,HIGH,0 //NC
++ SPEC_GP 100,OUT,HIGH,0 //NC
++ SPEC_GP 101,OUT,HIGH,0 //NC
++ SPEC_GP 102,OUT,HIGH,0 //NC
++ SPEC_GP 103,OUT,HIGH,0 //port 1,USB Power Enable for REV 1 board (driver needs to enable usb power (LOW,0)
++ SPEC_GP 104,OUT,HIGH,0 //NC
++
++#if (PLATFORM_REV==1)
++ SPEC_GP 105,IN,HIGH,0 //USB Overcurrent
++#else
++ SPEC_GP 105,OUT,HIGH,0 //NC
++#endif
++
++ SPEC_GP 106,OUT,HIGH,0 //NC
++ SPEC_GP 107,OUT,HIGH,0 //NC
++ SPEC_GP 108,OUT,HIGH,0 //NC
++ SPEC_GP 109,OUT,HIGH,1 //MMDAT 1
++ SPEC_GP 110,OUT,HIGH,1 //MMDAT 2
++ SPEC_GP 111,OUT,HIGH,1 //MMDAT 3
++ SPEC_GP 112,OUT,HIGH,1 //MMCMD
++ SPEC_GP 113,OUT,HIGH,2 //AC97 Reset, NC
++ SPEC_GP 114,OUT,HIGH,0 //NC
++ SPEC_GP 115,OUT,HIGH,0 //NC
++ SPEC_GP 116,OUT,HIGH,0 //NC
++ SPEC_GP 117,OUT,HIGH,1 //SCL (I2C)
++ SPEC_GP 118,OUT,HIGH,1 //SDA (I2C)
++ SPEC_GP 119,OUT,HIGH,0 //NC
++ SPEC_GP 120,OUT,HIGH,0 //NC
++ SPEC_GP 121,IN,LOW,0 //undefined
++ SPEC_GP 122,IN,LOW,0 //undefined
++ SPEC_GP 123,IN,LOW,0 //undefined
++ SPEC_GP 124,IN,LOW,0 //undefined
++ SPEC_GP 125,IN,LOW,0 //undefined
++ SPEC_GP 126,IN,LOW,0 //undefined
++ SPEC_GP 127,IN,LOW,0 //undefined
++
++// ****************************************************************************
++ CREATE_MASK_DIR DRVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++ CREATE_MASK_LEVEL SRVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++ CREATE_MASK_ALT AFVAL0, SPEC_, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
++ CREATE_MASK_ALT AFVAL16,SPEC_,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
++
++ CREATE_MASK_DIR DRVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++ CREATE_MASK_LEVEL SRVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++ CREATE_MASK_ALT AFVAL32,SPEC_,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
++ CREATE_MASK_ALT AFVAL48,SPEC_,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
++
++ CREATE_MASK_DIR DRVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++ CREATE_MASK_LEVEL SRVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++ CREATE_MASK_ALT AFVAL64,SPEC_,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
++ CREATE_MASK_ALT AFVAL80,SPEC_,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
++
++ CREATE_MASK_DIR DRVAL96,SPEC_,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
++ CREATE_MASK_LEVEL SRVAL96,SPEC_,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
++ CREATE_MASK_ALT AFVAL96,SPEC_, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111
++ CREATE_MASK_ALT AFVAL112,SPEC_,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
++
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaGpio.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaGpio.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,142 @@
++#include "platformTypes.h"
++
++#define IN 0
++#define OUT 1
++
++#define LOW 0
++#define HIGH 1
++
++ .ifdef __ARMASM
++.macro SPEC_GP gp_,dir,level,alt
++SPEC_\gp_ EQU \dir+(\level<<8)+(\alt<<16)
++.endm
++ .else
++.macro SPEC_GP gp_,dir,level,alt
++ .set SPEC_\gp_,\dir+(\level<<8)+(\alt<<16)
++.endm
++ .endif
++// *****************************************************************************************
++.macro CREATE_MASK_DIR name,prefix,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31
++ .ifdef __ARMASM
++ LCLA mask
++ .endif
++ .set mask,((\prefix\p0&1)<<(\p0&0x1f))
++ .set mask,mask | ((\prefix\p1&1)<<(\p1&0x1f))
++ .set mask,mask | ((\prefix\p2&1)<<(\p2&0x1f))
++ .set mask,mask | ((\prefix\p3&1)<<(\p3&0x1f))
++ .set mask,mask | ((\prefix\p4&1)<<(\p4&0x1f))
++ .set mask,mask | ((\prefix\p5&1)<<(\p5&0x1f))
++ .set mask,mask | ((\prefix\p6&1)<<(\p6&0x1f))
++ .set mask,mask | ((\prefix\p7&1)<<(\p7&0x1f))
++ .set mask,mask | ((\prefix\p8&1)<<(\p8&0x1f))
++ .set mask,mask | ((\prefix\p9&1)<<(\p9&0x1f))
++ .set mask,mask | ((\prefix\p10&1)<<(\p10&0x1f))
++ .set mask,mask | ((\prefix\p11&1)<<(\p11&0x1f))
++ .set mask,mask | ((\prefix\p12&1)<<(\p12&0x1f))
++ .set mask,mask | ((\prefix\p13&1)<<(\p13&0x1f))
++ .set mask,mask | ((\prefix\p14&1)<<(\p14&0x1f))
++ .set mask,mask | ((\prefix\p15&1)<<(\p15&0x1f))
++ .set mask,mask | ((\prefix\p16&1)<<(\p16&0x1f))
++ .set mask,mask | ((\prefix\p17&1)<<(\p17&0x1f))
++ .set mask,mask | ((\prefix\p18&1)<<(\p18&0x1f))
++ .set mask,mask | ((\prefix\p19&1)<<(\p19&0x1f))
++ .set mask,mask | ((\prefix\p20&1)<<(\p20&0x1f))
++ .set mask,mask | ((\prefix\p21&1)<<(\p21&0x1f))
++ .set mask,mask | ((\prefix\p22&1)<<(\p22&0x1f))
++ .set mask,mask | ((\prefix\p23&1)<<(\p23&0x1f))
++ .set mask,mask | ((\prefix\p24&1)<<(\p24&0x1f))
++ .set mask,mask | ((\prefix\p25&1)<<(\p25&0x1f))
++ .set mask,mask | ((\prefix\p26&1)<<(\p26&0x1f))
++ .set mask,mask | ((\prefix\p27&1)<<(\p27&0x1f))
++ .set mask,mask | ((\prefix\p28&1)<<(\p28&0x1f))
++ .set mask,mask | ((\prefix\p29&1)<<(\p29&0x1f))
++ .set mask,mask | ((\prefix\p30&1)<<(\p30&0x1f))
++ .set mask,mask | ((\prefix\p31&1)<<(\p31&0x1f))
++ .ifdef __ARMASM
++\name EQU mask
++ .else
++ .set \name,mask
++ .endif
++.endm
++
++.macro CREATE_MASK_LEVEL name,prefix,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31
++ .ifdef __ARMASM
++ LCLA mask
++ .endif
++ .set mask,(((\prefix\p0>>8)&1)<<(\p0&0x1f))
++ .set mask,mask | (((\prefix\p1>>8)&1)<<(\p1&0x1f))
++ .set mask,mask | (((\prefix\p2>>8)&1)<<(\p2&0x1f))
++ .set mask,mask | (((\prefix\p3>>8)&1)<<(\p3&0x1f))
++ .set mask,mask | (((\prefix\p4>>8)&1)<<(\p4&0x1f))
++ .set mask,mask | (((\prefix\p5>>8)&1)<<(\p5&0x1f))
++ .set mask,mask | (((\prefix\p6>>8)&1)<<(\p6&0x1f))
++ .set mask,mask | (((\prefix\p7>>8)&1)<<(\p7&0x1f))
++ .set mask,mask | (((\prefix\p8>>8)&1)<<(\p8&0x1f))
++ .set mask,mask | (((\prefix\p9>>8)&1)<<(\p9&0x1f))
++ .set mask,mask | (((\prefix\p10>>8)&1)<<(\p10&0x1f))
++ .set mask,mask | (((\prefix\p11>>8)&1)<<(\p11&0x1f))
++ .set mask,mask | (((\prefix\p12>>8)&1)<<(\p12&0x1f))
++ .set mask,mask | (((\prefix\p13>>8)&1)<<(\p13&0x1f))
++ .set mask,mask | (((\prefix\p14>>8)&1)<<(\p14&0x1f))
++ .set mask,mask | (((\prefix\p15>>8)&1)<<(\p15&0x1f))
++ .set mask,mask | (((\prefix\p16>>8)&1)<<(\p16&0x1f))
++ .set mask,mask | (((\prefix\p17>>8)&1)<<(\p17&0x1f))
++ .set mask,mask | (((\prefix\p18>>8)&1)<<(\p18&0x1f))
++ .set mask,mask | (((\prefix\p19>>8)&1)<<(\p19&0x1f))
++ .set mask,mask | (((\prefix\p20>>8)&1)<<(\p20&0x1f))
++ .set mask,mask | (((\prefix\p21>>8)&1)<<(\p21&0x1f))
++ .set mask,mask | (((\prefix\p22>>8)&1)<<(\p22&0x1f))
++ .set mask,mask | (((\prefix\p23>>8)&1)<<(\p23&0x1f))
++ .set mask,mask | (((\prefix\p24>>8)&1)<<(\p24&0x1f))
++ .set mask,mask | (((\prefix\p25>>8)&1)<<(\p25&0x1f))
++ .set mask,mask | (((\prefix\p26>>8)&1)<<(\p26&0x1f))
++ .set mask,mask | (((\prefix\p27>>8)&1)<<(\p27&0x1f))
++ .set mask,mask | (((\prefix\p28>>8)&1)<<(\p28&0x1f))
++ .set mask,mask | (((\prefix\p29>>8)&1)<<(\p29&0x1f))
++ .set mask,mask | (((\prefix\p30>>8)&1)<<(\p30&0x1f))
++ .set mask,mask | (((\prefix\p31>>8)&1)<<(\p31&0x1f))
++ .ifdef __ARMASM
++\name EQU mask
++ .else
++ .set \name,mask
++ .endif
++.endm
++
++.macro CREATE_MASK_ALT name,prefix,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15
++ .ifdef __ARMASM
++ LCLA mask
++ .endif
++ .set mask,(((\prefix\p0>>16)&3)<<((\p0&0x0f)<<1))
++ .set mask,mask | (((\prefix\p1>>16)&3)<<((\p1&0x0f)<<1))
++ .set mask,mask | (((\prefix\p2>>16)&3)<<((\p2&0x0f)<<1))
++ .set mask,mask | (((\prefix\p3>>16)&3)<<((\p3&0x0f)<<1))
++ .set mask,mask | (((\prefix\p4>>16)&3)<<((\p4&0x0f)<<1))
++ .set mask,mask | (((\prefix\p5>>16)&3)<<((\p5&0x0f)<<1))
++ .set mask,mask | (((\prefix\p6>>16)&3)<<((\p6&0x0f)<<1))
++ .set mask,mask | (((\prefix\p7>>16)&3)<<((\p7&0x0f)<<1))
++ .set mask,mask | (((\prefix\p8>>16)&3)<<((\p8&0x0f)<<1))
++ .set mask,mask | (((\prefix\p9>>16)&3)<<((\p9&0x0f)<<1))
++ .set mask,mask | (((\prefix\p10>>16)&3)<<((\p10&0x0f)<<1))
++ .set mask,mask | (((\prefix\p11>>16)&3)<<((\p11&0x0f)<<1))
++ .set mask,mask | (((\prefix\p12>>16)&3)<<((\p12&0x0f)<<1))
++ .set mask,mask | (((\prefix\p13>>16)&3)<<((\p13&0x0f)<<1))
++ .set mask,mask | (((\prefix\p14>>16)&3)<<((\p14&0x0f)<<1))
++ .set mask,mask | (((\prefix\p15>>16)&3)<<((\p15&0x0f)<<1))
++ .ifdef __ARMASM
++\name EQU mask
++ .else
++ .set \name,mask
++ .endif
++.endm
++
++#if (PLATFORM_TYPE==NEON)||(PLATFORM_TYPE==NEONB)||(PLATFORM_TYPE==BD2003)||(PLATFORM_TYPE==BOUNDARY_OLD_BOARD)
++#define ALT_LCD 2
++#include "pxaGpio25x.h"
++#else
++#if (PLATFORM_TYPE==HALOGEN)
++#define ALT_LCD 2
++#include "pxaGpio27x.h"
++#else
++#include "pxaGpioGame.h"
++#endif
++#endif
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaHardware.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaHardware.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaHardware.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaHardware.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,288 @@
++//#define GPIO_BASE 0x40E00000
++#define GPLR0 0x00 //level
++#define GPLR1 0x04
++#define GPLR2 0x08
++#define GPLR3 0x100 //level
++
++#define GPDR0 0x0c //direction
++#define GPDR1 0x10
++#define GPDR2 0x14
++#define GPDR3 0x10c //direction
++
++#define GPSR0 0x18 //set
++#define GPSR1 0x1C
++#define GPSR2 0x20
++#define GPSR3 0x118 //set
++
++#define GPCR0 0x24 //clear
++#define GPCR1 0x28
++#define GPCR2 0x2c
++#define GPCR3 0x124 //clear
++
++#define GRER0 0x30 //enable rising edge detect
++#define GRER1 0x34
++#define GRER2 0x38
++#define GRER3 0x130 //enable rising edge detect
++
++#define GFER0 0x3C //enable falling edge detect
++#define GFER1 0x40
++#define GFER2 0x44
++#define GFER3 0x13C //enable falling edge detect
++
++#define GEDR0 0x48 //edge detect status
++#define GEDR1 0x4C
++#define GEDR2 0x50
++#define GEDR3 0x148 //edge detect status
++
++#define GAFR0_L 0x54 //alternate function
++#define GAFR0_U 0x58
++#define GAFR1_L 0x5C
++#define GAFR1_U 0x60
++#define GAFR2_L 0x64
++#define GAFR2_U 0x68
++#define GAFR3_L 0x6c
++#define GAFR3_U 0x70
++
++
++#define UART_RBR 0 //read, DLAB-0 :RECEIVE_BUFFER
++#define UART_THR 0 //write, DLAB-0 :TRANSMIT_BUFFER
++#define UART_DLL 0 //r/w, DLAB-1 :DIVISOR_LOW
++#define UART_IER 4 //r/w, DLAB-0 :INTERRUPT_ENABLE
++#define UART_DLH 4 //r/w, DLAB-1 :DIVISOR_HIGH
++
++#define UART_IIR 8 //read :INTERRUPT_INDENTIFICATION
++#define UART_FCR 8 //write :FIFO_CONTROL
++#define UART_LCR 0x0c //r/w :LINE_CONTROL
++#define UART_MCR 0x10 //r/w :MODEM_CONTROL
++#define UART_LSR 0x14 //read :LINE_STATUS
++#define UART_MSR 0x18 //read :MODEM_STATUS
++#define UART_SPR 0x1c //r/w :SCRATCH_PAD
++#define UART_ISR 0x20 //r/w :INFRARED
++
++//#define IC_BASE 0x40D00000
++#define ICIP 0x00 //IRQ pending status
++#define ICMR 0x04 //interrupt controller mask
++#define ICLR 0x08 //level, 0 - irq, 1 -fiq
++#define ICFP 0x0C //FIQ pending status
++#define ICPR 0x10 //all interrupts pending, no mask
++#define ICCR 0x14 //0 - ignore ICMR in idle mode, 1 - only unmasked interrupts will awaken processor
++
++
++#define __SKIP 8
++#define ICL1_GPIO0 (8 - __SKIP)
++#define ICL1_GPIO1 (9 - __SKIP)
++#define ICL1_GPIO2_80 (10 - __SKIP)
++#define ICL1_USB (11 - __SKIP)
++#define ICL1_PMU (12 - __SKIP)
++#define ICL1_I2S (13 - __SKIP)
++#define ICL1_AC97 (14 - __SKIP)
++#define ICL1_LCD (17 - __SKIP)
++#define ICL1_I2C (18 - __SKIP)
++#define ICL1_ICP (19 - __SKIP)
++#define ICL1_STUART (20 - __SKIP)
++#define ICL1_BTUART (21 - __SKIP)
++#define ICL1_FFUART (22 - __SKIP)
++#define ICL1_MMC (23 - __SKIP)
++#define ICL1_SSP (24 - __SKIP)
++#define ICL1_DMA (25 - __SKIP)
++#define ICL1_OS_TIMER0 (26 - __SKIP)
++#define ICL1_OS_TIMER1 (27 - __SKIP)
++#define ICL1_OS_TIMER2 (28 - __SKIP)
++#define ICL1_OS_TIMER3 (29 - __SKIP)
++#define ICL1_RTC_TICK (30 - __SKIP)
++#define ICL1_RTC_ALARM_MATCH (31 - __SKIP)
++
++//#define OS_TIMER_BASE 0x40a00000
++#define OSMR0 0x00
++#define OSMR1 0x04
++#define OSMR2 0x08
++#define OSMR3 0x0c
++#define OSCR 0x10 //OS timer Count register, increments at 3.6864 Mhz
++#define OSSR 0x14 //OS timer Status Register
++#define OWER 0x18 //OS timer Watchdog Match enable register
++#define OIER 0x1c
++
++//3686400 ticks/seconds = 3.6864 ticks/usec = 1 tick/.271267361111 usec
++#define TICK_PER_USEC_WHOLE 3
++#define TICK_PER_USEC_FRAC 0xAFB7E910
++//////////////////////////////////////////////////////////////////////////////////////////
++
++//#define PWR_MANAGER_BASE 0x40F00000
++#define PMCR 0
++#define PSSR 4
++#define PSPR 8
++#define PWER 0x0c
++#define PRER 0x10
++#define PFER 0x14
++#define PEDR 0x18
++#define PCFR 0x1c
++#define PGSR0 0x20
++#define PGSR1 0x24
++#define PGSR2 0x28
++#define RCSR 0x30
++
++#define PSSR_MASK 0x37
++#define RCSR_MASK 0x0f
++#define RCSR_SLEEP_RESET 4
++
++//#define CLK_MANAGER_BASE 0x41300000
++#define CCCR 0
++#define CKEN 4
++#define OSCC 8
++
++//#define MEMORY_CONTROL_BASE 0x48000000
++#define MDCNFG 0
++#define MDREFR 4
++#define MSC0 8
++#define MSC1 0x0c
++#define MSC2 0x10
++#define MECR 0x14
++#define SXCNFG 0x1c
++#define SXMRS 0x24
++#define MCMEM0 0x28
++#define MCMEM1 0x2c
++#define MCATT0 0x30
++#define MCATT1 0x34
++#define MCIO0 0x38
++#define MCIO1 0x3c
++#define MDMRS 0x40
++#define BOOT_DEF 0x44
++
++
++//#define LCD_CONTROL_BASE 0x44000000
++#define LCD_CR0 0 //master enable last
++#define LCD_CR1 4
++#define LCD_CR2 8
++#define LCD_CR3 0x0c
++#define LCD_FBR0 0x20 //Frame branch register
++#define LCD_FBR1 0x24 //Frame branch register
++#define LCD_SR 0x38
++#define LCD_INT_ID 0x3c
++#define LCD_TMEDS 0x40 //TMED RGB seed
++#define LCD_TMEDC 0x44 //TMED control
++#define LCD_FDADR0 0x200 //frame descriptor address register
++#define LCD_FDADR1 0x210 //frame descriptor address register
++
++#define LCD_FSADR0 0x204 //frame source address register
++#define LCD_FSADR1 0x214 //frame source address register
++
++#define LCD_FIDR0 0x208 //frame ID register
++#define LCD_FIDR1 0x218 //frame ID register
++
++#define LCD_DCMD0 0x20c //dma command
++#define LCD_DCMD1 0x21c //dma command
++
++#define CRO_LDDALT 26 //LDDALT ;0 selects RGB 555, 1 selects RGB 565
++#define CRO_OUC 25 //OUC ;0 underlays, 1 overlays
++#define CR0_CMDIM 24 //CMDIM ;command interrupt mask, 0 - enabled, 1 disabled
++#define CR0_RDSTM 23 //RDSTM ;read status interrupt mask, 0 - enabled, 1 disabled
++#define CR0_LCDT 22 //LCDT ;LCD Panel Type, 1 - internal frame buffer
++#define CR0_IM_OUTPUT_FIFO_UNDERRUN 21 //OUM IM stands for Interrupt Mask
++#define CR0_IM_BRANCH 20 //BSM0
++#define CR0_PALETTE_DMA_REQUEST_DELAY 12 //PDD 8 bit field, 0-255
++#define CR0_IM_LCD_QUICK_DISABLE 11 //QDM
++#define CR0_DISABLE 10 //DIS
++#define CR0_DOUBLE_PIXEL_DATA 9 //DPD
++#define CR0_ACTIVE_SELECT 7 //PAS
++#define CR0_IM_END_OF_FRAME 6 //EOFM0
++#define CR0_IM_INPUT_FIFO_UNDERRUN 5 //IUM
++#define CR0_IM_START_OF_FRAME 4 //SOFM0
++#define CR0_IM_DISABLE_DONE 3 //LDM
++#define CR0_DUAL_PANEL_SELECT 2 //SDS
++#define CR0_MONOCHROME_SELECT 1 //CMS
++#define CR0_ENABLE 0 //ENB
++
++
++
++
++#define CR1_BEGINNING_OF_LINE_WAIT 24 //8 bit field +1
++#define CR1_END_OF_LINE_WAIT 16 //8 bit field +1
++#define CR1_HORIZONTAL_SYNC_PULSE_WIDTH 10 //6 bit field +1
++#define CR1_PIXELS_PER_LINE 0 //10 bit field +1
++
++
++
++#define CR2_BEGINNING_OF_FRAME_WAIT 24 //8 bit field
++#define CR2_END_OF_FRAME_WAIT 16 //8 bit field
++#define CR2_VERTICAL_SYNC_PULSE_WIDTH 10 //6 bit field +1
++#define CR2_LINES_PER_PANEL 0 //10 bit field +1
++
++
++#define CR3_PDFOR 30
++#define CR3_DOUBLE_PCLK 27
++#define CR3_BITS_PER_PIXEL 24 //3 bit field
++//0 - 1 bit
++//1 - 2 bits
++//2 - 4 bits
++//3 - 8 bits
++//4 - 16 bits,
++//5-7 reserved
++#define CR3_BIAS_POLARITY 23
++#define CR3_PCLK_POLARITY 22
++#define CR3_LCLK_POLARITY 21
++#define CR3_FCLK_POLARITY 20
++#define CR3_API 16 //4 bits field, ac bias transitions per interrupt, 0 disable
++#define CR3_ACBIAS_TOGGLE 8 //8 bit field +1
++#define CR3_PCLK_DIVISOR 0 //8 bit field +1
++
++
++
++#define FBR_BRANCH_INT 1
++#define FBR_BRANCH 0
++
++
++#define SR_MISSED_INT 10
++#define SR_BRANCH_INT 9
++#define SR_END_OF_FRAME_INT 8
++#define SR_QUICK_DISABLE_INT 7
++#define SR_OUTPUT_FIFO_UNDERRUN 6
++#define SR_INPUT_FIFO_UNDERRUN0 5
++#define SR_INPUT_FIFO_UNDERRUN1 4
++#define SR_ACBIAS_COUNT_INT 3
++#define SR_BUS_ERROR 2
++#define SR_START_OF_FRAME 1
++#define SR_DISABLE_DONE 0
++
++#define TMEDS_BLUE 16 //8 bit field
++#define TMEDS_GREEN 8 //8 bit field
++#define TMEDS_RED 0 //8 bit field
++
++
++#define TMEDC_MATRIX2_SELECT 14
++#define TMEDC_RESERVED 12 //2 bit field
++#define TMEDC_HORIZONTAL_BEAT_SUPPRESSION 8 //4 bit field
++#define TMEDC_VERTICAL_BEAT_SUPPRESSION 4 //4 bit field
++#define TMEDC_FRAME_NUMBER_ADJUST_EN 3
++#define TMEDC_COLOR_OFFSET_ADJUST_EN 2
++#define TMEDC_FRAME_NUMBER_ADJUST_MATRIX2 1
++#define TMEDC_COLOR_OFFSET_ADJUST_MATRIX2 0
++
++
++#define DCMD_PALETTE 26
++#define DCMD_START_OF_FRAME_INTERRUPT 22
++#define DCMD_END_OF_FRAME_INTERRUPT 21
++#define DCMD_LENGTH 0 //21 bit field
++
++
++#define FDESC_FDADR 0
++#define FDESC_FSADR 4
++#define FDESC_FIDR 8
++#define FDESC_DCMD 0x0c
++
++#define PSR_MODE_MASK 0x1f
++#define PSR_MODE_USER 0x10
++#define PSR_MODE_FIQ 0x11
++#define PSR_MODE_IRQ 0x12
++#define PSR_MODE_SVC 0x13
++#define PSR_MODE_DEBUG 0x15
++#define PSR_MODE_ABORT 0x17
++#define PSR_MODE_UNDEF 0x1b
++#define PSR_MODE_SYSTEM 0x1f
++#define PSR_NOINTS_MASK 0xc0
++
++#define FUNC_REQ_GL 0
++#define FUNC_REQ_DLW 1
++#define FUNC_REQ_GAME 2 //not specifically referenced
++#define FUNC_REQ_MAC 3
++#define FUNC_REQ_WAKEUP 4
++#define FUNC_REQ_PIC 5
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaLcd2.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaLcd2.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaLcd2.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaLcd2.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,78 @@
++#include "pxaLcd.h"
++#define DA320X240 0
++#define DA640X240 1
++#define DA800X480 2
++#define DA640X480 3
++#define DA240X320 4
++#define DA800X600 5
++#define DA1024X768 6
++#define DP480X320 7
++#define DP320X240 8
++#define DL122X32 9
++#define UNKNOWN 0xcc
++
++#ifdef __ARMASM
++ GBLS DEF_P
++#endif
++
++#if DISPLAY_TYPE==DA320X240 //5.7 inch display
++#define DEF_P DA320X240_P
++#define DEF_DISPLAY_INDEX 0
++#else
++#if DISPLAY_TYPE==DA640X240 //6.2 inch display
++#define DEF_P DA640X240_P
++#define DEF_DISPLAY_INDEX 1
++#else
++#if DISPLAY_TYPE==DA800X480 //7 or 9 inch display
++#define DEF_P DA800X480_P
++#define DEF_DISPLAY_INDEX 2
++#else
++#if DISPLAY_TYPE==DA640X480 //10.4 inch display
++#define DEF_P DA640X480_P
++#define DEF_DISPLAY_INDEX 3
++#else
++#if DISPLAY_TYPE==DA240X320 //3.5 inch display
++#define DEF_P DA240X320_P
++#define DEF_DISPLAY_INDEX 4
++#else
++#if DISPLAY_TYPE==DA800X600
++#define DEF_P DA800X600_P
++#define DEF_DISPLAY_INDEX 5
++#else
++#if DISPLAY_TYPE==DA1024X768
++#define DEF_P DA1024X768_P
++#define DEF_DISPLAY_INDEX 6
++#else
++#if DISPLAY_TYPE==DP480X320 //5.7 inch display
++#define DEF_P DP480X320_P
++#define DEF_DISPLAY_INDEX 7
++#else
++#if DISPLAY_TYPE==DP320X240 //5.7 inch display
++#define DEF_P DP320X240_P
++#define DEF_DISPLAY_INDEX 8
++#else
++#if DISPLAY_TYPE==DL122X32
++#define DEF_P DL122X32_P
++#define DEF_DISPLAY_INDEX 9
++#else
++#if DISPLAY_TYPE==UNKNOWN
++#define DEF_P DA320X240_P
++#define DEF_DISPLAY_INDEX 0xcc
++
++#else
++#define DEF_P DA320X240_P
++#define DEF_DISPLAY_INDEX 0
++#warning "No display selected, defaulting to DA320X240"
++
++#endif //0xcc
++#endif //9
++#endif //8
++#endif //7
++#endif //6
++#endif //5
++#endif //4
++#endif //3
++#endif //2
++#endif //1
++#endif //0
++
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaLcd.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaLcd.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaLcd.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaLcd.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,79 @@
++#include "platformTypes.h"
++#define WINCE 1
++#define LINUX 2
++#define GAME 3
++
++#define PXAFB_BPP 16
++
++#define LCD_PANEL 0
++#define CRT 1
++
++//pixel clock frequency = LCLK / (2*(PCD+1))
++#if (PLATFORM_TYPE==HALOGEN)
++#define __BPP 18
++#define BPP_FORMAT 6
++#define PDFOR 3
++#define BYTES_PER_PIXEL 3
++#else
++#define __BPP 16
++#define BPP_FORMAT 4
++#define PDFOR 0
++#define BYTES_PER_PIXEL 2
++#endif
++
++// ****************************************************************************
++// This is where different display settings reside
++// xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++//#define DA320X240_P 320, 64, 34, 1, 240, 20, 8, 3, 1,0,0,1,PXAFB_BPP,4,LCD_PANEL //0
++#define DA320X240_P 320, 64, 34, 11, 240, 5, 8, 3, 1,0,0,1,PXAFB_BPP,4,LCD_PANEL //0
++
++#define DA640X240_P 640, 64, 34, 1, 240, 20, 8, 3, 1,1,0,1,PXAFB_BPP,2,LCD_PANEL //1
++#define DA800X480_P 800, 64, 34, 1, 480, 20, 8, 3, 1,1,0,1,PXAFB_BPP,2,LCD_PANEL //2
++#define DA640X480_P 640, 64, 34,105, 480, 20, 8,14, 1,1,0,1,PXAFB_BPP,2,LCD_PANEL //3
++#define DA240X320_P 240, 64, 34, 1, 320, 20, 8, 3, 1,0,1,1,PXAFB_BPP,5,LCD_PANEL //4
++#define DA800X600_P 800,0x9b,0x31,0x69, 600,0x04,0x01,0x17, 1,1,0,1,PXAFB_BPP,2,CRT //5
++//#define DA1024X768_P 1024,0xc8,0x55,0xb4, 768,0x06,0x0b,0x1d, 1,1,0,1,PXAFB_BPP,2,CRT //6
++//#define DA1024X768_P 1024,0xe4,0x3c,0x70, 768,0x0c,0x0b,0x20, 1,1,0,1,PXAFB_BPP,2,CRT //6
++#define DA1024X768_P 1024,0xe4,0x3c,0x70, 768,0x0c,0x0b,0x20, 1,1,0,1,PXAFB_BPP,2,LCD_PANEL //6
++#define DP480X320_P 480, 64, 34, 1, 320,20,8,3, 1,0,0,0,PXAFB_BPP,3,LCD_PANEL //7
++#define DP320X240_P 320, 64, 34, 1, 240,20,8,3, 1,0,0,0,PXAFB_BPP,4,LCD_PANEL //8
++#define DL122X32_P 320, 64, 34, 1, 240,20,8,3, 0,0,0,0,PXAFB_BPP,4,0 //9
++
++// ********************************************************************************
++#if (PLATFORM_TYPE==BOUNDARY_OLD_BOARD)
++#define MOTHERBOARD_SCRAMBLED
++#endif
++
++//#define CONFIG_UNSCRAMBLE_LCD
++#ifdef CONFIG_UNSCRAMBLE_LCD
++#if 1 //FL_ACTIVE(DEF_P) //passive cannot swap pin order
++#ifdef MOTHERBOARD_SCRAMBLED
++
++#ifndef DAUGHTERBOARD_UNSCRAMBLE
++#define LCD_REORDER_BLUE 15,14, 8, 7, 6
++#define LCD_REORDER_GREEN 13,12,11, 5, 4, 3
++#define LCD_REORDER_RED 10, 9, 2, 1, 0
++#endif
++
++#else
++//motherboard is NOT scrambled
++#ifdef DAUGHTERBOARD_UNSCRAMBLE
++#define LCD_REORDER_BLUE 15,14,13,10, 9
++#define LCD_REORDER_GREEN 8, 4, 3, 2, 12, 11
++#define LCD_REORDER_RED 7, 6, 5, 1, 0
++#endif
++#endif //#ifdef MOTHERBOARD_SCRAMBLED
++#endif //#if FL_ACTIVE(DEF_P)
++#endif //#ifdef CONFIG_UNSCRAMBLE_LCD
++
++#ifndef LCD_REORDER_BLUE
++#if (BYTES_PER_PIXEL==2)
++#define LCD_REORDER_BLUE 0,1,2,3,4
++#define LCD_REORDER_GREEN 5,6,7,8,9,10
++#define LCD_REORDER_RED 11,12,13,14,15
++#else
++#define LCD_REORDER_BLUE 0,1,2,3,4,5
++#define LCD_REORDER_GREEN 6,7,8,9,10,11
++#define LCD_REORDER_RED 12,13,14,15,16,17
++#endif
++#endif
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro2.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro2.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro2.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro2.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,540 @@
++#include "pxaMacro.h"
++// ************************************************************************************************
++// ************************************************************************************************
++
++//In: c-0 try 64meg, c-1 try 32meg
++// or if 16 bit mode
++// c-0 try 32meg, c-1 try 16meg
++//Out: z-0 if 16 bit mode
++.macro InitRam rBase,rTemp
++ BigMov \rBase,MEMORY_CONTROL_BASE
++ ldr \rTemp,[\rBase,#BOOT_DEF]
++ tst \rTemp,#1 //bit 0 - 1 means 16 bit mode
++ BigMov \rTemp,M64_MDCNFG_VAL
++ BigEor2Cs \rTemp,(M64_MDCNFG_VAL)^(M32_MDCNFG_VAL)
++#if (!(PLATFORM_TYPE==NEONB)) && (!(PLATFORM_TYPE==HALOGEN))
++ BigOrr2Ne \rTemp,(1<<2) //select 16 bit width
++#endif
++ str \rTemp,[\rBase,#MDCNFG]
++
++ mov \rTemp,#0
++ nop //pxa270 may need this for some reason, depending upon instruction alignment
++ str \rTemp,[\rBase,#MDMRS]
++
++
++ BigMov \rTemp,M64_MDREFR_VAL
++ BigEor2Cs \rTemp,(M64_MDREFR_VAL)^(M32_MDREFR_VAL)
++ str \rTemp,[\rBase,#MDREFR]
++.endm
++
++
++//In: z-1 - c-0 try 64meg, c-1 try 32meg
++// z-0 - c-0 try 32meg, c-1 try 16meg
++//out: rTemp - memory size
++.macro CheckRam rBase,rTemp,rTemp2
++ // Issue read requests to disabled bank to start refresh
++ BigMov \rBase,MEM_START+0x0C000000
++ ldr \rTemp, [\rBase]
++ mov \rTemp,#M32_MEM_SIZE
++ movcc \rTemp,#M64_MEM_SIZE
++#if (!(PLATFORM_TYPE==NEONB)) && (!(PLATFORM_TYPE==HALOGEN))
++ movne \rTemp,\rTemp,LSR #1
++#endif
++ BigMov \rBase,MEM_START
++#if 1
++ mov \rTemp2,#0x24<<2 //0x24 seems to work, but keep it safe
++81: sub \rTemp2,\rTemp2,#1
++ str \rTemp2,[\rBase]
++ movs \rTemp2,\rTemp2 //don't affect carry flag
++ bne 81b
++#endif
++ str \rTemp,[\rBase]
++ str \rBase,[\rBase,\rTemp,LSR #1]
++ ldr \rTemp2,[\rBase]
++ movcs \rTemp2,\rTemp //if 2nd time through, force match
++ cmp \rTemp2,\rTemp
++#if 1
++ strne \rTemp2,[\rBase,#4]
++// teq \rTemp2,\rTemp2
++#endif
++.endm
++
++#define tEHEL 0 //R14
++#define tAPA 3 //r15 25ns/10ns rounded up
++
++#define RDFSelect 13 //R2 : tAVQV : 110ns/10ns = 11; 11-1=10=RDF
++//#define RDFSelect 10 //R2 : tAVQV : 110ns/10ns = 11; 11-1=10=RDF
++ //0-11 map to 0-11
++ //12 -> 13, 13 ->15, 14->18, 15->23
++
++//#if (PLATFORM_TYPE==GAME_CONTROLLER_PLAITED_A1)
++#if (PLATFORM_TYPE==GAME_CONTROLLER_PLAITED_A1)||(PLATFORM_TYPE==GAME_CONTROLLER)||(PLATFORM_TYPE==GAME_WITH_SMC)
++#define BurstSelect 0 //if plaited bug, burst mode will no longer work.
++#else
++#define BurstSelect 2 //0->nonburst,1->SRAM,2->burst of4, 3->burst of 8, 4->variable latency i/o
++#endif
++
++
++#if (PLATFORM_TYPE==NEONB)
++//access time 70ns, 25ns after CS data becomes valid
++// RRR RDN RDF RBW RTX
++// gap between Address to
++// 1-fast chip selects data valid
++// 0-slow recovery 2nd burst access 1st access delay 16-bit bus non-burst(0), sram(1), 4cycle(2), 8cycle(3), VLIO(4)
++#define CS0_MSC (1<<15)+ (1<<12)+ (7<<8)+ ((7-1)<<4)+ 0
++#define CS1_MSC (1<<15)+(((tEHEL+1)>>1)<<12)+((tAPA-1)<<8)+ (RDFSelect<<4)+ (BurstSelect) //fast device
++#else
++#define CS0_MSC (1<<15)+(((tEHEL+1)>>1)<<12)+((tAPA-1)<<8)+ (RDFSelect<<4)+ (BurstSelect) //fast device
++#define CS1_MSC (1<<15)+ (3<<12)+ (2<<8)+ ((3-1)<<4)+ (1<<3) + 4 //SMC chip
++//#define CS1_MSC (1<<15)+ (6<<12)+ ((11-1)<<8)+ ((4-1)<<4)+ (1<<3) + 4 //SMC chip
++#endif
++
++.macro InitCS0_CS1 rBase,rTemp
++ BigMov \rBase,MEMORY_CONTROL_BASE
++ ldr \rTemp,[\rBase,#BOOT_DEF]
++ tst \rTemp,#1 //bit 0 - 1 means 16 bit mode
++ BigMov \rTemp,(CS0_MSC)|((CS1_MSC)<<16)
++/////// BigMov \rTemp,0x7ff07ff0
++ orrne \rTemp,\rTemp,#1<<3 //16 bit bus
++ str \rTemp,[\rBase,#MSC0]
++.endm
++
++
++.macro InitMemory rBase,rTemp,rTemp2
++ cmp pc,#MEM_START
++ bcs 92f //exit if running from ram
++#if 0 //1 to force smaller memory
++ subs \rTemp,\rTemp,\rTemp //set carry flag
++#endif
++
++1:
++ InitRam \rBase, \rTemp //out: \rBase - MEMORY_CONTROL_BASE
++
++#if (PLATFORM_TYPE==BOUNDARY_OLD_BOARD)
++#define CHIP_MODE 0 //don't use VIO_READY
++#else
++#define CHIP_MODE 4 //gp18 is VIO_READY
++#endif
++
++// RRR RDN RDF RBW RTX
++// gap between Address to
++// 1-fast chip selects data valid
++// 0-slow recovery 2nd burst access 1st access delay 16-bit bus non-burst(0), sram(1), 4cycle(2), 8cycle(3), VLIO(4)
++#if 1
++#define CS2_MSC (1<<15)+ (4<<12)+ ((6-2)<<8)+ ((4-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++//#define CS2_MSC (1<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++
++// vlio min 2 vlio min 3
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==NEONB)
++#define CS3_MSC (1<<15)+ (1<<12)+ (2<<8)+ ((4-1)<<4)+ (0<<3) + 4 //SM501
++#define CS4_MSC (1<<15)+ (3<<12)+ (2<<8)+ ((4-1)<<4)+ (0<<3) + 4 //SMC chip
++#else
++#if (PLATFORM_TYPE==HALOGEN)
++#define CS3_MSC (1<<15)+ (1<<12)+ (2<<8)+ ((4-1)<<4)+ (0<<3) + 4 //NC
++#define CS4_MSC (1<<15)+ (3<<12)+ (2<<8)+ ((5-1)<<4)+ (0<<3) + 4 //SMC chip
++#else
++#define CS3_MSC (1<<15)+ (4<<12)+ ((6-2)<<8)+ ((4-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++//#define CS3_MSC (1<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++#define CS4_MSC (1<<15)+ (6<<12)+ ((11-1)<<8)+ ((4-1)<<4)+ (1<<3) + CHIP_MODE //for USB IO
++#endif
++#endif
++
++#define CS5_MSC (0<<15)+ (7<<12)+ ((8-1)<<8)+ ((8-1)<<4)+ (1<<3) + (0) //for USB IO delay after CMD write
++#else
++#define CS2_MSC (1<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++#define CS3_MSC (1<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + CHIP_MODE //for USB dma
++#define CS4_MSC (1<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + CHIP_MODE //for USB IO
++#define CS5_MSC (0<<15)+ (7<<12)+ ((16-1)<<8)+ ((16-1)<<4)+ (1<<3) + (0) //for USB IO delay after CMD write
++#endif
++ BigMov \rTemp,(CS2_MSC)|((CS3_MSC)<<16)
++ str \rTemp,[\rBase,#MSC1]
++ BigMov \rTemp,(CS4_MSC)|((CS5_MSC)<<16)
++ str \rTemp,[\rBase,#MSC2]
++
++
++
++#define PCMCIA_MEM_SETUP_ADDRESS 5 //0-127
++#define PCMCIA_MEM_COMMAND_CODE 3 //0-31
++#define PCMCIA_MEM_HOLD_ADDRESS 2 //0-63
++ BigMov \rTemp,(PCMCIA_MEM_HOLD_ADDRESS<<14)+(PCMCIA_MEM_COMMAND_CODE<<7)+(PCMCIA_MEM_SETUP_ADDRESS<<0)
++ str \rTemp,[\rBase,#MCMEM0]
++ str \rTemp,[\rBase,#MCMEM1]
++#define PCMCIA_ATT_SETUP_ADDRESS 5 //0-127
++#define PCMCIA_ATT_COMMAND_CODE 3 //0-31
++#define PCMCIA_ATT_HOLD_ADDRESS 2 //0-63
++ BigMov \rTemp,(PCMCIA_ATT_HOLD_ADDRESS<<14)+(PCMCIA_ATT_COMMAND_CODE<<7)+(PCMCIA_ATT_SETUP_ADDRESS<<0)
++ str \rTemp,[\rBase,#MCATT0]
++ str \rTemp,[\rBase,#MCATT1]
++#define PCMCIA_IO_SETUP_ADDRESS 5 //0-127
++#define PCMCIA_IO_COMMAND_CODE 3 //0-31
++#define PCMCIA_IO_HOLD_ADDRESS 2 //0-63
++ BigMov \rTemp,(PCMCIA_IO_HOLD_ADDRESS<<14)+(PCMCIA_IO_COMMAND_CODE<<7)+(PCMCIA_IO_SETUP_ADDRESS<<0)
++ str \rTemp,[\rBase,#MCIO0]
++ str \rTemp,[\rBase,#MCIO1]
++ mov \rTemp,#2
++ str \rTemp,[\rBase,#MECR]
++
++ CheckRam \rBase, \rTemp, \rTemp2
++ cmpne \rTemp,#0x0 //set carry flag, keep z-0 (memory size!=0)
++ bne 1b
++92:
++.endm
++
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++#define CKEN_PWM0 0
++#define CKEN_PWM1 1
++#define CKEN_AC97 2
++#define CKEN_SSP 3
++#define CKEN_HWUART 4
++#define CKEN_STUART 5
++#define CKEN_FFUART 6
++#define CKEN_BTUART 7
++#define CKEN_I2S 8
++#define CKEN_USB 11
++#define CKEN_MMC 12
++#define CKEN_FICP 13
++#define CKEN_I2C 14
++#define CKEN_LCD 16
++
++#if (PLATFORM_TYPE==NEON) || (PLATFORM_TYPE==BD2003) || (PLATFORM_TYPE==BOUNDARY_OLD_BOARD) || (PLATFORM_TYPE==OLD_GAME_CONTROLLER) || (PLATFORM_TYPE==HALOGEN)
++#define __ENABLED_BTUART_MASK (1<<CKEN_BTUART)
++#define __ENABLED_STUART_MASK (1<<CKEN_STUART)
++#endif
++
++#if (PLATFORM_TYPE==BD2003) || (PLATFORM_TYPE==BOUNDARY_OLD_BOARD) || (PLATFORM_TYPE==OLD_GAME_CONTROLLER) || (PLATFORM_TYPE==HALOGEN)
++#define __ENABLED_LCD_MASK (1<<CKEN_LCD)
++#endif
++
++#ifndef __ENABLED_BTUART_MASK
++#define __ENABLED_BTUART_MASK 0
++#endif
++
++#ifndef __ENABLED_STUART_MASK
++#define __ENABLED_STUART_MASK 0
++#endif
++
++#ifndef __ENABLED_LCD_MASK
++#define __ENABLED_LCD_MASK 0
++#endif
++
++.macro InitIC_Clocks rBase,rTemp
++ BigMov \rBase,IC_BASE
++ mov \rTemp,#0
++ str \rTemp,[\rBase,#ICMR] //disable all interrupts
++
++ BigMov \rBase,CLK_MANAGER_BASE
++#if (PLATFORM_TYPE==HALOGEN)
++#define CKEN_MEMORY_CONTROLLER 22
++#define CKEN_OS_TIMER 9
++
++#define CCCR_L_BIT 0
++#define CCCR_2N_BIT 7
++#define CCCR_A_BIT 25
++
++#define CLKCFG_TURBO_BIT 0
++#define CLKCFG_FREQUENCY_CHANGE_BIT 1
++#define CLKCFG_HALF_TURBO_BIT 2
++#define CLKCFG_FAST_BUS_BIT 3
++
++#if (CPU_CLOCK==104) //13*8 = 104MHz
++#define CCCR_2N 2
++#define CCCR_L 8
++#define CCCR_A 0
++#define CLKCFG_TURBO 0
++#define CLKCFG_FAST_BUS 0
++#else
++#if (CPU_CLOCK==208) //13*16 = 208MHz
++#define CCCR_2N 2
++#define CCCR_L 16
++#define CCCR_A 0
++#define CLKCFG_TURBO 0
++#define CLKCFG_FAST_BUS 0
++#else
++#if (CPU_CLOCK==312) //312MHz
++#define CCCR_2N 3
++#define CCCR_L 16
++#define CCCR_A 0
++#define CLKCFG_TURBO 1
++#define CLKCFG_FAST_BUS 0
++#else
++#if (CPU_CLOCK==416) //416MHz
++#define CCCR_2N 4
++#define CCCR_L 16
++#define CCCR_A 0
++#define CLKCFG_TURBO 1
++#define CLKCFG_FAST_BUS 1
++#else
++#if (CPU_CLOCK==520) //520MHz
++#define CCCR_2N 5
++#define CCCR_L 16
++#define CCCR_A 0
++#define CLKCFG_TURBO 1
++#define CLKCFG_FAST_BUS 1
++#else
++#if (CPU_CLOCK==624) //624MHz
++#define CCCR_2N 6
++#define CCCR_L 16
++#define CCCR_A 0
++#define CLKCFG_TURBO 1
++#define CLKCFG_FAST_BUS 1
++
++#else
++#warning CPU_CLOCK selection not made
++#endif
++#endif
++#endif
++#endif
++#endif
++#endif
++ BigMov \rTemp,(CCCR_L<<CCCR_L_BIT)+(CCCR_2N<<CCCR_2N_BIT)+(CCCR_A<<CCCR_A_BIT)
++ str \rTemp,[\rBase,#CCCR]
++
++ BigMov \rTemp,(1<<CKEN_OS_TIMER)+(1<<CKEN_MEMORY_CONTROLLER)+(1<<CKEN_FFUART)+__ENABLED_BTUART_MASK+__ENABLED_STUART_MASK+__ENABLED_LCD_MASK
++ str \rTemp,[\rBase,#CKEN]
++
++#else
++#define tRP 20
++#define tRCD 20
++#define tRAS 45 //45 ns
++#define tRC 65
++// CRYSTALns 10000000/ 36864 //271ns
++
++#define LSelect 1 //1 : *27 = 10.0469 ns memory clk time, 99.53 MHz
++ // tRP_clk = tRCD_clk= 1.99066 -> 2 clks
++ // tRAS_clk= 4.47899 -> 5 clks
++ // tRC_clk= 6.46966 -> 7 clks
++ //2 : *32 = 8.47711 ns, 117.96 MHz
++ // tRP_clk = tRCD_clk= 2.35929 -> 3 clks
++ // tRAS_clk=5.30841 -> 6
++ // tRC_clk =7.66771 -> 8 clks
++ //3 : *36 = 7.5352 ns, 132.71 MHz
++ // tRP_clk = tRCD_clk= 2.65421 -> 3 clks
++ // tRAS_clk=5.97197 -> 6
++ // tRC_clk = 8.62618 -> 9 clks
++ //4 : *40 = 6.78168ns, 147.46 MHz
++ // tRP_clk = tRCD_clk= 2.94912 -> 3 clks
++ // tRAS_clk=6.63522 -> 7
++ // tRC_clk = 9.58465 -> 10 clks
++ //5 : *45 = 6.02816ns, 165.89 MHz
++ // tRP_clk = tRCD_clk= 3.31776 -> 4 clks
++ // tRAS_clk=7.46496 -> 8
++ // tRC_clk = 10.7827 -> 11 clks
++//MSelect
++//1 : *1
++//2 : *2
++
++//NSelect
++//2 : *1;
++//3 : *1.5;
++//4 : *2;
++//6 : *3
++
++#if (CPU_CLOCK==100)
++#define MSelect 1 //1 : *1 100MHz
++#define NSelect 4 //4 : *2; turbo 200 MHZ
++#define FCS_MASK 2 // turbo off
++#else
++#if (CPU_CLOCK==200)
++#define MSelect 2 //2 : *2 200 MHz
++#define NSelect 3 //3 : *1.5; turbo 300 MHZ
++#define FCS_MASK 2 // turbo off
++#else
++#if (CPU_CLOCK==300)
++#define MSelect 2 //2 : *2 200 MHz
++#define NSelect 3 //3 : *1.5; turbo 300 MHZ
++#define FCS_MASK 3 // turbo on
++#else
++#if (CPU_CLOCK==400)
++
++#if 0 //only pxa255 runs with 200Mhz internal bus, pxa250 doesn't
++#define MSelect 2 //2 : *2 200 MHz
++#define NSelect 4 //4 : *2; turbo 400 MHZ
++#define FCS_MASK 3 // turbo on
++#else
++#define MSelect 3 //2 : *4 400 MHz
++#define NSelect 2 //4 : *1; turbo 400 MHZ
++#define FCS_MASK 2 // turbo off
++#endif
++
++#else
++//////#WARNING CPU_CLOCK selection not made
++#endif
++#endif
++#endif
++#endif
++
++ BigMov \rTemp,(NSelect<<7)+(MSelect<<5)+(LSelect)
++ str \rTemp,[\rBase,#CCCR]
++
++ BigMov \rTemp,(1<<CKEN_FFUART)+__ENABLED_BTUART_MASK+__ENABLED_STUART_MASK+__ENABLED_LCD_MASK
++ str \rTemp,[\rBase,#CKEN]
++#endif //not HALOGEN
++ mov \rTemp,#0 //disable 32.768khz oscillator
++// mov \rTemp,#2 //enable 32.768khz oscillator
++ str \rTemp,[\rBase,#OSCC]
++.endm
++
++.macro InitChangeCPUSpeed rTemp
++#if (PLATFORM_TYPE==HALOGEN)
++ mov \rTemp,#(CLKCFG_FAST_BUS<<CLKCFG_FAST_BUS_BIT)+(CLKCFG_TURBO<<CLKCFG_TURBO_BIT)+(1<<CLKCFG_FREQUENCY_CHANGE_BIT)
++ CP14_CCLKCFG mcr,\rTemp
++#else
++ mov \rTemp,#FCS_MASK
++ CP14_CCLKCFG mcr,\rTemp
++#endif
++.endm
++
++// *******************************************************************************************
++// *******************************************************************************************
++
++.macro InitUART rBase,rTemp,uartaddr,baudrate
++ BigMov \rBase,\uartaddr
++
++ mov \rTemp,#0x83 //DLAB, 8-bit characters
++ str \rTemp,[\rBase,#UART_LCR]
++ mov \rTemp,#(14745600/((\baudrate)<<4))&0xff
++ str \rTemp,[\rBase,#UART_DLL]
++ mov \rTemp,#((14745600/((\baudrate)<<4))>>8)
++ str \rTemp,[\rBase,#UART_DLH]
++
++ mov \rTemp,#3 //8-bit characters
++ str \rTemp,[\rBase,#UART_LCR]
++
++ mov \rTemp,#0xc1 //enable fifo, 32 byte level
++ str \rTemp,[\rBase,#UART_FCR]
++
++ mov \rTemp,#0x40 //UUE- UART unit enable
++ str \rTemp,[\rBase,#UART_IER]
++.endm
++.macro InitGPIO rBase,rTemp
++ BigMov \rBase,GPIO_BASE
++
++ BigMov \rTemp,~SRVAL0
++ str \rTemp,[\rBase,#GPCR0]
++ mvn \rTemp,\rTemp
++ str \rTemp,[\rBase,#GPSR0]
++
++ BigMov \rTemp,~SRVAL32
++ str \rTemp,[\rBase,#GPCR1]
++ mvn \rTemp,\rTemp
++ str \rTemp,[\rBase,#GPSR1]
++
++ BigMov \rTemp,~SRVAL64
++ str \rTemp,[\rBase,#GPCR2]
++ mvn \rTemp,\rTemp
++ str \rTemp,[\rBase,#GPSR2]
++#if (PLATFORM_TYPE==HALOGEN)
++ BigMov \rTemp,~SRVAL96
++ str \rTemp,[\rBase,#GPCR3]
++ mvn \rTemp,\rTemp
++ str \rTemp,[\rBase,#GPSR3]
++#endif
++////////
++ BigMov \rTemp,DRVAL0
++ str \rTemp,[\rBase,#GPDR0]
++
++ BigMov \rTemp,DRVAL32
++ str \rTemp,[\rBase,#GPDR1]
++
++ BigMov \rTemp,DRVAL64
++ str \rTemp,[\rBase,#GPDR2]
++#if (PLATFORM_TYPE==HALOGEN)
++ BigMov \rTemp,DRVAL96
++ str \rTemp,[\rBase,#GPDR3]
++#endif
++////////
++ BigMov \rTemp,AFVAL0
++ str \rTemp,[\rBase,#GAFR0_L]
++ BigMov \rTemp,AFVAL16
++ str \rTemp,[\rBase,#GAFR0_U]
++
++ BigMov \rTemp,AFVAL32
++ str \rTemp,[\rBase,#GAFR1_L]
++ BigMov \rTemp,AFVAL48
++ str \rTemp,[\rBase,#GAFR1_U]
++
++ BigMov \rTemp,AFVAL64
++ str \rTemp,[\rBase,#GAFR2_L]
++ BigMov \rTemp,AFVAL80
++ str \rTemp,[\rBase,#GAFR2_U]
++#if (PLATFORM_TYPE==HALOGEN)
++ BigMov \rTemp,AFVAL96
++ str \rTemp,[\rBase,#GAFR3_L]
++ BigMov \rTemp,AFVAL112
++ str \rTemp,[\rBase,#GAFR3_U]
++#endif
++ BigMov \rBase,PWR_MANAGER_BASE
++ mov \rTemp,#0x30
++ str \rTemp,[\rBase,#PSSR]
++.endm
++
++
++
++.macro TransMacro val
++ BigMov r12,UART_BASE
++91:
++ BigMov r0,\val
++ bl Transmit
++ b 91b
++.endm
++// *******************************************************************************************
++.macro InitMMU rBase,rTemp
++// mov r0,#PSR_NOINTS_MASK+PSR_MODE_SVC
++// msr cpsr_c,r0
++// ********************************************************************
++// Disable the MMU and gang regardless of why we are here.
++ BigMov \rBase,0x2001 //; enable access to all coprocessors
++ CP15_CP_ACCESS mcr,\rBase
++ CPWAIT \rBase
++
++ mov \rBase,#0x00000078 //; get a zero to turn things off (must write bits[6:3] as 1's)
++ CP15_CONTROL mcr,\rBase //; Turn Off MMU, I&D Caches, WB.
++ CPWAIT \rBase
++
++ mov \rBase,#0x00000000 //; get a zero to turn things off
++ cmp pc,#MEM_START
++ CP15_TLB_INVAL_BOTH mcr,\rBase //; flush (invalidate) I/D tlb's
++ CP15_CF_INVAL_BTB mcr,\rBase //invalidate Branch target buffer
++ CP15_CF_INVAL_D mcr,\rBase
++ CP15_CF_INVAL_I mcrcs,\rBase //I might be running from cache only, invalidate if in ram
++ CP15_CF_DRAIN mcr,\rBase //; Drain the write buffer
++ nop
++ nop
++ nop
++ mvn r0, #0 //; grant manager access to all domains
++ CP15_DACR mcr,\rBase
++.endm
++
++//out rTemp1 reset reason
++.macro InitPWR rBase,rTemp1,rTemp2
++ BigMov \rBase,PWR_MANAGER_BASE
++// ********************************************************************
++ ldr \rTemp1,[\rBase,#RCSR] // Read & Init Reset Cause bits in RCSR.
++ and \rTemp1,\rTemp1,#RCSR_MASK // extract the reset cause bits
++ str \rTemp1,[\rBase,#RCSR] // clear the reset cause bits (they're sticky)
++// ********************************************************************
++// Read and store PSSR, too - it will be reset later, after GPIOs are initialized.
++// Unclear when we'll need this information, but don't throw a good status away.
++// ldr \rTemp2, [\rBase,#PSSR]
++// extract the reset cause bits
++// and \rTemp2,\rTemp2,#PSSR_MASK //; r12 now holds the conditioned PSSR
++// orr \rTemp1,\rTemp1,\rTemp2,lsl #16 //; R10 now has RCSR in lower half and PSSR in upper.
++// ********************************************************************
++// Reasons for being here:
++// 1) Hard Reset
++// 2) Wake from Sleep
++// 3) GPIO Reset
++// 4) Watchdog Reset
++// 5) Eboot Handoff
++// If Sleep_Reset: reinit all but RTC, PWRMAN, CLKS (except cp14)... so reinit: OST, INTC, GPIO
++// If GPIO_Reset: reinit all but MEMC.Config, RTC, CLKS (except cp14)... so reinit: treat like sleep
++// If Watchdog_Reset: reinit all but RTC.RTTR, CLK.OSCC... so reinit: treat like a hard reset, minus OSCC and RTTR init.
++// If Hard_Reset: reinit all
++.endm
++
++// *******************************************************************************************
++// *******************************************************************************************
++ .list
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro3.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro3.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro3.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro3.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,74 @@
++#include "pxaLcd2.h"
++#include "pxaMacro2.h"
++.macro DEFINE_SCREEN_WIDTH xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++ .ifdef __ARMASM
++ GBLA SCREEN_WIDTH
++ .endif
++ .set SCREEN_WIDTH,\xres
++.endm
++
++.macro DEFINE_SCREEN_HEIGHT xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++ .ifdef __ARMASM
++ GBLA SCREEN_HEIGHT
++ .endif
++ .set SCREEN_HEIGHT,\yres
++.endm
++
++ DEFINE_SCREEN_WIDTH DEF_P
++ DEFINE_SCREEN_HEIGHT DEF_P
++
++.macro CR0_INIT_VAL reg,xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++ BigMov \reg,(\enable<<CR0_ENABLE)+(1<<CR0_IM_DISABLE_DONE)+(1<<CR0_IM_START_OF_FRAME)+\
++ (1<<CR0_IM_INPUT_FIFO_UNDERRUN)+(1<<CR0_IM_END_OF_FRAME)+(\active<<CR0_ACTIVE_SELECT)+\
++ (1<<CR0_IM_LCD_QUICK_DISABLE)+(1<<CR0_IM_BRANCH)+(1<<CR0_IM_OUTPUT_FIFO_UNDERRUN)
++.endm
++
++.macro CR1_INIT_VAL reg,xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++ BigMov \reg,((\xres-1)<<CR1_PIXELS_PER_LINE)+((\xsyncWidth-1)<<CR1_HORIZONTAL_SYNC_PULSE_WIDTH)+\
++ ((\xend-1)<<CR1_END_OF_LINE_WAIT)+((\xbegin-1)<<CR1_BEGINNING_OF_LINE_WAIT)
++.endm
++
++.macro CR2_INIT_VAL reg,xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++ BigMov \reg,((\yres-1)<<CR2_LINES_PER_PANEL)+((\ysyncWidth-1)<<CR2_VERTICAL_SYNC_PULSE_WIDTH)+\
++ (\yend<<CR2_END_OF_FRAME_WAIT)+(\ybegin<<CR2_BEGINNING_OF_FRAME_WAIT)
++.endm
++
++.macro CR3_INIT_VAL reg,xres,xsyncWidth,xbegin,xend, yres,ysyncWidth,ybegin,yend, enable,unscramble,rotate,active,bpp,clkdiv,type
++//LCD Clock is same as memory clock
++ BigMov \reg,(\clkdiv<<CR3_PCLK_DIVISOR)+((256-1)<<CR3_ACBIAS_TOGGLE)+\
++ (0<<CR3_API)+(0<<CR3_FCLK_POLARITY)+(0<<CR3_LCLK_POLARITY)+\
++ (1<<CR3_PCLK_POLARITY)+(0<<CR3_BIAS_POLARITY)+\
++ (BPP_FORMAT<<CR3_BITS_PER_PIXEL)+(0<<CR3_DOUBLE_PCLK)+(PDFOR<<CR3_PDFOR)
++.endm
++
++#define TMEDS_INIT_VAL (0xaa<<TMEDS_BLUE)+(0x55<<TMEDS_GREEN)+(0x00<<TMEDS_RED)
++#define TMEDC_INIT_VAL (1<<TMEDC_MATRIX2_SELECT)+(3<<TMEDC_RESERVED)+(5<<TMEDC_HORIZONTAL_BEAT_SUPPRESSION)+(4<<TMEDC_VERTICAL_BEAT_SUPPRESSION)+(1<<TMEDC_FRAME_NUMBER_ADJUST_EN)+(1<<TMEDC_COLOR_OFFSET_ADJUST_EN)+(1<<TMEDC_FRAME_NUMBER_ADJUST_MATRIX2)+(1<<TMEDC_COLOR_OFFSET_ADJUST_MATRIX2)
++
++
++.macro InitLCD rBase,rTemp,rDescript
++
++ BigMov \rBase,LCD_CONTROL_BASE
++
++ CR1_INIT_VAL \rTemp,DEF_P
++ str \rTemp,[\rBase,#LCD_CR1]
++
++ CR2_INIT_VAL \rTemp,DEF_P
++ str \rTemp,[\rBase,#LCD_CR2]
++
++ CR3_INIT_VAL \rTemp,DEF_P
++ str \rTemp,[\rBase,#LCD_CR3]
++
++ BigMov \rTemp,0
++ str \rTemp,[\rBase,#LCD_FBR0]
++ str \rTemp,[\rBase,#LCD_FBR1]
++
++ BigMov \rTemp,TMEDS_INIT_VAL
++ str \rTemp,[\rBase,#LCD_TMEDS]
++ BigMov \rTemp,TMEDC_INIT_VAL
++ str \rTemp,[\rBase,#LCD_TMEDC]
++
++ str \rDescript,[\rBase,#LCD_FDADR0]
++
++ CR0_INIT_VAL \rTemp,DEF_P
++ str \rTemp,[\rBase,#LCD_CR0]
++.endm
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxaMacro.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxaMacro.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,343 @@
++#include "pxa250Base.h"
++#include "pxaHardware.h"
++#include "BigMacro.h"
++ .nolist
++
++//CP14 registers
++.macro CP14_PMNC ins,rx
++ \ins p14,0,\rx,c0,c0,0
++.endm
++.macro CP14_CCNT ins,rx
++ \ins p14,0,\rx,c1,c0,0
++.endm
++.macro CP14_PMN0 ins,rx
++ \ins p14,0,\rx,c2,c0,0
++.endm
++.macro CP14_PMN1 ins,rx
++ \ins p14,0,\rx,c3,c0,0
++.endm
++.macro CP14_CCLKCFG ins,rx
++ \ins p14,0,\rx,c6,c0,0
++.endm
++.macro CP14_PWRMODE ins,rx
++ \ins p14,0,\rx,c7,c0,0
++.endm
++.macro CP14_TX ins,rx
++ \ins p14,0,\rx,c8,c0,0
++.endm
++.macro CP14_RX ins,rx
++ \ins p14,0,\rx,c9,c0,0
++.endm
++.macro CP14_DCSR ins,rx
++ \ins p14,0,\rx,c10,c0,0 //debug control and status register
++.endm
++.macro CP14_TBREG ins,rx
++ \ins p14,0,\rx,c11,c0,0 //trace buffer register
++.endm
++.macro CP14_CHKPT0 ins,rx
++ \ins p14,0,\rx,c12,c0,0 //checkpoint register 0
++.endm
++.macro CP14_CHKPT1 ins,rx
++ \ins p14,0,\rx,c13,c0,0 //checkpoint register 1
++.endm
++.macro CP14_TXRXCTRL ins,rx
++ \ins p14,0,\rx,c14,c0,0
++.endm
++
++
++//CP15 registers
++.macro CP15_ID ins,rx
++ \ins p15,0,\rx,c0,c0,0
++.endm
++.macro CP15_CACHETYPE ins,rx
++ \ins p15,0,\rx,c0,c0,1
++.endm
++.macro CP15_CONTROL ins,rx
++ \ins p15,0,\rx,c1,c0,0
++.endm
++.macro CP15_AUXCONTROL ins,rx
++ \ins p15,0,\rx,c1,c0,1
++.endm
++.macro CP15_TTBR ins,rx
++ \ins p15,0,\rx,c2,c0,0 //translation table base
++.endm
++.macro CP15_DACR ins,rx
++ \ins p15,0,\rx,c3,c0,0 //domain access control register
++.endm
++.macro CP15_FSR ins,rx
++ \ins p15,0,\rx,c5,c0,0 //fault status register
++.endm
++.macro CP15_FAR ins,rx
++ \ins p15,0,\rx,c6,c0,0 //fault address register
++.endm
++
++.macro CP15_CF_ALLOC_LINE ins,rx
++ \ins p15,0,\rx,c7,c2,5 //allocate line in data cache
++.endm
++.macro CP15_CF_INVAL_I ins,rx
++ \ins p15,0,\rx,c7,c5,0 //invalidate instruction cache
++.endm
++.macro CP15_CF_INVAL_ILINE ins,rx
++ \ins p15,0,\rx,c7,c5,1
++.endm
++.macro CP15_CF_INVAL_BTB ins,rx
++ \ins p15,0,\rx,c7,c5,6 //invalidate Branch target buffer
++.endm
++.macro CP15_CF_INVAL_D ins,rx
++ \ins p15,0,\rx,c7,c6,0
++.endm
++.macro CP15_CF_INVAL_DLINE ins,rx
++ \ins p15,0,\rx,c7,c6,1
++.endm
++.macro CP15_CF_INVAL_BOTH ins,rx
++ \ins p15,0,\rx,c7,c7,0 //invalidate instruction & data cache & BTB
++.endm
++.macro CP15_CF_CLEAN_DLINE ins,rx
++ \ins p15,0,\rx,c7,c10,1
++.endm
++.macro CP15_CF_DRAIN ins,rx
++ \ins p15,0,\rx,c7,c10,4
++.endm
++
++.macro CP15_TLB_INVAL_I ins,rx
++ \ins p15,0,\rx,c8,c5,0
++.endm
++.macro CP15_TLB_INVAL_IENTRY ins,rx
++ \ins p15,0,\rx,c8,c5,1
++.endm
++.macro CP15_TLB_INVAL_D ins,rx
++ \ins p15,0,\rx,c8,c6,0
++.endm
++.macro CP15_TLB_INVAL_DENTRY ins,rx
++ \ins p15,0,\rx,c8,c6,1
++.endm
++.macro CP15_TLB_INVAL_BOTH ins,rx
++ \ins p15,0,\rx,c8,c7,0
++.endm
++
++.macro CP15_CF_LOCK_ILINE ins,rx
++ \ins p15,0,\rx,c9,c1,0 //mva to fetch and lock
++.endm
++.macro CP15_CF_UNLOCK_I ins,rx
++ \ins p15,0,\rx,c9,c1,1 //unlock all lines
++.endm
++.macro CP15_CF_LOCK_D_CSR ins,rx
++ \ins p15,0,\rx,c9,c2,0
++.endm
++.macro CP15_CF_UNLOCK_D ins,rx
++ \ins p15,0,\rx,c9,c2,1 //unlock all lines in data cache
++.endm
++
++.macro CP15_TLB_LOCK_IENTRY ins,rx
++ \ins p15,0,\rx,c10,c4,0
++.endm
++.macro CP15_TLB_UNLOCK_I ins,rx
++ \ins p15,0,\rx,c10,c4,1
++.endm
++.macro CP15_TLB_LOCK_DENTRY ins,rx
++ \ins p15,0,\rx,c10,c8,0
++.endm
++.macro CP15_TLB_UNLOCK_D ins,rx
++ \ins p15,0,\rx,c10,c8,1
++.endm
++
++.macro CP15_PID ins,rx
++ \ins p15,0,\rx,c13,c0,0
++.endm
++
++.macro CP15_DBR0 ins,rx
++ \ins p15,0,\rx,c14,c0,0 //Data Breakpoint address register 0
++.endm
++.macro CP15_DBR1 ins,rx
++ \ins p15,0,\rx,c14,c3,0 //Data Breakpoint address/mask register 1
++.endm
++.macro CP15_DBCON ins,rx
++ \ins p15,0,\rx,c14,c4,0 //Data Breakpoint control register
++.endm
++.macro CP15_IBCR0 ins,rx
++ \ins p15,0,\rx,c14,c8,0 //Instruction Breakpoint Control Register 0
++.endm
++.macro CP15_IBCR1 ins,rx
++ \ins p15,0,\rx,c14,c9,0 //Instruction Breakpoint Control Register 1
++.endm
++
++.macro CP15_CP_ACCESS ins,rx
++ \ins p15,0,\rx,c15,c1,0 //Coprocessor access register, set bit n to enable access to coprocessor n
++.endm
++
++
++.macro CPWAIT dest
++ CP15_ID mrc,\dest //read some register in CP15
++ mov \dest,\dest //wait for the read to complete
++ sub pc,pc,#4 //branch to the next instruction, flushing the instruction pipeline
++.endm
++
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// ************************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++// *******************************************************************************************
++
++#define numColumnAddrBits 9
++#define numBankAddrBits 2
++#define ClkSelect 1 //0 : tRP = 2, tRCD = 1, tRAS = 3, tRC = 4
++ //1 : tRP = 2, tRCD = 2, tRAS = 5, tRC = 8
++ //2 : tRP = 3, tRCD = 3, tRAS = 7, tRC = 10
++ //3 : tRP = 3, tRCD = 3, tRAS = 7, tRC = 11
++//64 meg option
++#define M64_numRowAddrBits 13 //for k4s561632a
++#define M64_SA1111_mask 0 //(1<<12)
++#define M64_DRI_cnt (((99530*64)>>M64_numRowAddrBits)>>5) //(# of cycles/ms * # of ms for entire refresh period)/ # of rows/refresh period /32
++#define M64_MDCNFG_VAL 1+((numColumnAddrBits-8)<<3)+((M64_numRowAddrBits-11)<<5)+((numBankAddrBits-1)<<7)+(ClkSelect<<8)+(1<<11)+(M64_SA1111_mask) //DLATCH0, latch return data with return clock
++#define M64_MDREFR_VAL (1<<16)+(1<<15)+(M64_DRI_cnt&0xfff) //don't set bit 20: APD (buggy), bit 16: K1RUN, 15:E1PIN
++//#define M64_MDREFR_VAL (1<<20)+(1<<16)+(1<<15)+(M64_DRI_cnt&0xfff) //20: APD, bit 16: K1RUN, 15:E1PIN
++// 13 9 2 2 (4bytes per address)=2**26=64 MB
++#define M64_MEM_SIZE (1<<(M64_numRowAddrBits+numColumnAddrBits+numBankAddrBits+2))
++#define M64_MEM_END ((MEM_START)+M64_MEM_SIZE)
++
++//32 meg option
++#define M32_numRowAddrBits 12 //for MT48LC8M16A2 - 75 B
++#define M32_SA1111_mask 0
++#define M32_DRI_cnt (((99530*64)>>M32_numRowAddrBits)>>5) //(# of cycles/ms * # of ms for entire refresh period)/ # of rows/refresh period /32
++#define M32_MDCNFG_VAL 1+((numColumnAddrBits-8)<<3)+((M32_numRowAddrBits-11)<<5)+((numBankAddrBits-1)<<7)+(ClkSelect<<8)+(1<<11)+(M32_SA1111_mask) //DLATCH0, latch return data with return clock
++#define M32_MDREFR_VAL (1<<16)+(1<<15)+(M32_DRI_cnt&0xfff) //don't set bit 20: APD (buggy), bit 16: K1RUN, 15:E1PIN
++// 12 9 2 2 (4bytes per address)=2**25=32 MB
++#define M32_MEM_SIZE (1<<(M32_numRowAddrBits+numColumnAddrBits+numBankAddrBits+2))
++#define M32_MEM_END ((MEM_START)+M32_MEM_SIZE)
++// *******************************************************************************************
++//out: rTemp - memory size
++.macro CalcMemSize rBase,rTemp,mem_control_base
++ BigMov \rBase,\mem_control_base
++ ldr \rTemp,[\rBase,#MDCNFG]
++ movs \rTemp,\rTemp,LSR #2+1 //bit 2 - 1 means 16 bit mode, 0 means 32 bit mode, mov to carry flag
++ tst \rTemp,#1<<(5-3) //is number of row address bits 12 or 13 ?
++ moveq \rTemp,#M64_MEM_SIZE
++ movne \rTemp,#M32_MEM_SIZE
++ movcs \rTemp,\rTemp,LSR #1 //half as much if 16 bit mode
++.endm
++
++
++#define CH_NULL 0x00
++#define CH_BACKSPACE 0x08
++#define CH_LF 0x0a
++#define CH_CR 0x0d
++#define CH_CAN 0x18
++#define CH_SPACE 0x20 //" "
++#define CH_EXCLAMATION 0x21 //!
++#define CH_DQUOTE 0x22 //"
++#define CH_POUND 0x23 //#
++#define CH_DOLLAR 0x24 //$
++#define CH_PERCENT 0x25 //%
++#define CH_AMPERSAND 0x26 //&
++#define CH_SQUOTE 0x27 //'
++#define CH_OPEN_PAREN 0x28 //(
++#define CH_CLOSE_PAREN 0x29 //)
++#define CH_ASTERISK 0x2a //*
++#define CH_PLUS 0x2b //+
++#define CH_COMMA 0x2c //,
++#define CH_HYPHEN 0x2d //-
++#define CH_MINUS 0x2d //-
++#define CH_PERIOD 0x2e //.
++#define CH_FSLASH 0x2f // /
++#define CH_0 0x30
++#define CH_1 0x31
++#define CH_2 0x32
++#define CH_3 0x33
++#define CH_4 0x34
++#define CH_5 0x35
++#define CH_6 0x36
++#define CH_7 0x37
++#define CH_8 0x38
++#define CH_9 0x39
++#define CH_COLON 0x3a //:
++#define CH_SEMICOLON 0x3b //;
++#define CH_LESS_THAN 0x3c //<
++#define CH_EQUAL 0x3d //=
++#define CH_GREATER_THAN 0x3e //>
++#define CH_QUESTION_MARK 0x3f //?
++#define CH_AT_SIGN 0x40 //@
++
++#define CH_A 0x41
++#define CH_B 0x42
++#define CH_C 0x43
++#define CH_D 0x44
++#define CH_E 0x45
++#define CH_F 0x46
++#define CH_G 0x47
++#define CH_H 0x48
++#define CH_I 0x49
++#define CH_J 0x4a
++#define CH_K 0x4b
++#define CH_L 0x4c
++#define CH_M 0x4d
++#define CH_N 0x4e
++#define CH_O 0x4f
++#define CH_P 0x50
++#define CH_Q 0x51
++#define CH_R 0x52
++#define CH_S 0x53
++#define CH_T 0x54
++#define CH_U 0x55
++#define CH_V 0x56
++#define CH_W 0x57
++#define CH_X 0x58
++#define CH_Y 0x59
++#define CH_Z 0x5a
++#define CH_OPEN_SQUARE 0x5b //[
++#define CH_BSLASH 0x5c //\..
++#define CH_CLOSE_SQUARE 0x5d //]
++#define CH_CARET 0x5e //^
++#define CH__ 0x5f //_
++#define CH_OPEN_SQUOTE 0x60 //`
++
++#define CH_a 0x61
++#define CH_b 0x62
++#define CH_c 0x63
++#define CH_d 0x64
++#define CH_e 0x65
++#define CH_f 0x66
++#define CH_g 0x67
++#define CH_h 0x68
++#define CH_i 0x69
++#define CH_j 0x6a
++#define CH_k 0x6b
++#define CH_l 0x6c
++#define CH_m 0x6d
++#define CH_n 0x6e
++#define CH_o 0x6f
++#define CH_p 0x70
++#define CH_q 0x71
++#define CH_r 0x72
++#define CH_s 0x73
++#define CH_t 0x74
++#define CH_u 0x75
++#define CH_v 0x76
++#define CH_w 0x77
++#define CH_x 0x78
++#define CH_y 0x79
++#define CH_z 0x7a
++#define CH_OPEN_CURLY 0x7b //{
++#define CH_VERTICAL_BAR 0x7c //|
++#define CH_CLOSE_CURLY 0x7d //}
++#define CH_TILDE 0x7e //~
++#define CH_DELETE 0x7f
++
++
++.macro STARTUPTEXT
++ GBLS AreaName
++ AREA |.astart|,ALIGN=2,CODE
++AreaName SETS "|.astart|"
++.endm
++
++.macro DUP count,val
++ LCLA cnt
++cnt SETA $count
++ WHILE ( cnt<>0)
++ DCD $val
++cnt SETA cnt-1
++ WEND
++.endm
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/arch-pxa/pxa-regs.h u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxa-regs.h
+--- u-boot-1.1.2/include/asm-arm/arch-pxa/pxa-regs.h 2003-06-27 23:32:42.000000000 +0200
++++ u-boot-1.1.2-neon/include/asm-arm/arch-pxa/pxa-regs.h 2007-08-11 21:07:21.000000000 +0200
+@@ -107,6 +107,17 @@
+ #define DCSR_RUN (1 << 31) /* Run Bit (read / write) */
+ #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */
+ #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
++
++#if defined(CONFIG_PXA27X)
++#define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
++#define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
++#define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
++#define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */
++#define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */
++#define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */
++#define DCSR_ENRINTR (1 << 9) /* The end of Receive */
++#endif
++
+ #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */
+ #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */
+ #define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */
+@@ -156,6 +167,10 @@
+ #define DRCMR38 __REG(0x40000198) /* Request to Channel Map Register for USB endpoint 14 Request */
+ #define DRCMR39 __REG(0x4000019C) /* Reserved */
+
++#define DRCMR68 __REG(0x40001110) /* Request to Channel Map Register for Camera FIFO 0 Request */
++#define DRCMR69 __REG(0x40001114) /* Request to Channel Map Register for Camera FIFO 1 Request */
++#define DRCMR70 __REG(0x40001118) /* Request to Channel Map Register for Camera FIFO 2 Request */
++
+ #define DRCMRRXSADR DRCMR2
+ #define DRCMRTXSADR DRCMR3
+ #define DRCMRRXBTRBR DRCMR4
+@@ -424,6 +439,12 @@
+ #define ISR __REG(0x40301698) /* I2C Status Register - ISR */
+ #define ISAR __REG(0x403016A0) /* I2C Slave Address Register - ISAR */
+
++#define PWRIBMR __REG(0x40f00180) /* Power I2C Bus Monitor Register-IBMR */
++#define PWRIDBR __REG(0x40f00188) /* Power I2C Data Buffer Register-IDBR */
++#define PWRICR __REG(0x40f00190) /* Power I2C Control Register - ICR */
++#define PWRISR __REG(0x40f00198) /* Power I2C Status Register - ISR */
++#define PWRISAR __REG(0x40f001A0) /* Power I2C Slave Address Register-ISAR */
++
+ /* ----- Control register bits ---------------------------------------- */
+
+ #define ICR_START 0x1 /* start bit */
+@@ -460,11 +481,9 @@
+ /*
+ * Serial Audio Controller
+ */
+-
+-
+ /* FIXME the audio defines collide w/ the SA1111 defines. I don't like these
+- * short defines because there is too much chance of namespace collision */
+-
++ * short defines because there is too much chance of namespace collision
++ */
+ /*#define SACR0 __REG(0x40400000) / Global Control Register */
+ /*#define SACR1 __REG(0x40400004) / Serial Audio I 2 S/MSB-Justified Control Register */
+ /*#define SASR0 __REG(0x4040000C) / Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
+@@ -711,10 +730,68 @@
+ #define USIR1_IR15 (1 << 7) /* Interrup request ep 15 */
+
+
++#if defined(CONFIG_PXA27X)
+ /*
+- * Fast Infrared Communication Port
++ * USB Host Controller
+ */
++#define USBH_BASE 0x4C000000
++#define UHCREV __REG(0x4C000000)
++#define UHCHCON __REG(0x4C000004)
++#define UHCCOMS __REG(0x4C000008)
++#define UHCINTS __REG(0x4C00000C)
++#define UHCINTE __REG(0x4C000010)
++#define UHCINTD __REG(0x4C000014)
++#define UHCHCCA __REG(0x4C000018)
++#define UHCPCED __REG(0x4C00001C)
++#define UHCCHED __REG(0x4C000020)
++#define UHCCCED __REG(0x4C000024)
++#define UHCBHED __REG(0x4C000028)
++#define UHCBCED __REG(0x4C00002C)
++#define UHCDHEAD __REG(0x4C000030)
++#define UHCFMI __REG(0x4C000034)
++#define UHCFMR __REG(0x4C000038)
++#define UHCFMN __REG(0x4C00003C)
++#define UHCPERS __REG(0x4C000040)
++#define UHCLST __REG(0x4C000044)
++#define UHCRHDA __REG(0x4C000048)
++#define UHCRHDB __REG(0x4C00004C)
++#define UHCRHS __REG(0x4C000050)
++#define UHCRHPS1 __REG(0x4C000054)
++#define UHCRHPS2 __REG(0x4C000058)
++#define UHCRHPS3 __REG(0x4C00005C)
++#define UHCSTAT __REG(0x4C000060)
++#define UHCHR __REG(0x4C000064)
++#define UHCHIE __REG(0x4C000068)
++#define UHCHIT __REG(0x4C00006C)
++
++#define UHCHR_FSBIR (1<<0)
++#define UHCHR_FHR (1<<1)
++#define UHCHR_CGR (1<<2)
++#define UHCHR_SSDC (1<<3)
++#define UHCHR_UIT (1<<4)
++#define UHCHR_SSE (1<<5)
++#define UHCHR_PSPL (1<<6)
++#define UHCHR_PCPL (1<<7)
++#define UHCHR_SSEP0 (1<<9)
++#define UHCHR_SSEP1 (1<<10)
++#define UHCHR_SSEP2 (1<<11)
++
++#define UHCHIE_UPRIE (1<<13)
++#define UHCHIE_UPS2IE (1<<12)
++#define UHCHIE_UPS1IE (1<<11)
++#define UHCHIE_TAIE (1<<10)
++#define UHCHIE_HBAIE (1<<8)
++#define UHCHIE_RWIE (1<<7)
++
++#define UHCCOMS_HCR 1
++#define UHCRHS_LPS 1
++#define UHCHR_SSE (1<<5)
++
++#endif
+
++/*
++ * Fast Infrared Communication Port
++ */
+ #define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */
+ #define ICCR1 __REG(0x40800004) /* ICP Control Register 1 */
+ #define ICCR2 __REG(0x40800008) /* ICP Control Register 2 */
+@@ -731,7 +808,21 @@
+ #define RTAR __REG(0x40900004) /* RTC Alarm Register */
+ #define RTSR __REG(0x40900008) /* RTC Status Register */
+ #define RTTR __REG(0x4090000C) /* RTC Timer Trim Register */
+-
++#define RDAR1 __REG(0x40900018) /* Wristwatch Day Alarm Reg 1 */
++#define RDAR2 __REG(0x40900020) /* Wristwatch Day Alarm Reg 2 */
++#define RYAR1 __REG(0x4090001C) /* Wristwatch Year Alarm Reg 1 */
++#define RYAR2 __REG(0x40900024) /* Wristwatch Year Alarm Reg 2 */
++#define SWAR1 __REG(0x4090002C) /* Stopwatch Alarm Register 1 */
++#define SWAR2 __REG(0x40900030) /* Stopwatch Alarm Register 2 */
++#define PIAR __REG(0x40900038) /* Periodic Interrupt Alarm Register */
++#define RDCR __REG(0x40900010) /* RTC Day Count Register. */
++#define RYCR __REG(0x40900014) /* RTC Year Count Register. */
++#define SWCR __REG(0x40900028) /* Stopwatch Count Register */
++#define RTCPICR __REG(0x40900034) /* Periodic Interrupt Counter Register */
++
++#define RTSR_PICE (1 << 15) /* Peridoc interrupt count enable */
++#define RTSR_PIALE (1 << 14) /* Peridoc interrupt Alarm enable */
++#define RTSR_PIAL (1 << 13) /* Peridoc interrupt Alarm status */
+ #define RTSR_HZE (1 << 3) /* HZ interrupt enable */
+ #define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */
+ #define RTSR_HZ (1 << 1) /* HZ rising-edge detected */
+@@ -831,6 +922,37 @@
+ /* More handy macros. The argument is a literal GPIO number. */
+
+ #define GPIO_bit(x) (1 << ((x) & 0x1f))
++
++#ifdef CONFIG_PXA27X
++
++/* Interrupt Controller */
++
++#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
++#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
++#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
++#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
++#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
++
++#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
++#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
++#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
++#define _GPCR(x) __REG2(0x40E00024, ((x) & 0x60) >> 3)
++#define _GRER(x) __REG2(0x40E00030, ((x) & 0x60) >> 3)
++#define _GFER(x) __REG2(0x40E0003C, ((x) & 0x60) >> 3)
++#define _GEDR(x) __REG2(0x40E00048, ((x) & 0x60) >> 3)
++#define _GAFR(x) __REG2(0x40E00054, ((x) & 0x70) >> 2)
++
++#define GPLR(x) ((((x) & 0x7f) < 96) ? _GPLR(x) : GPLR3)
++#define GPDR(x) ((((x) & 0x7f) < 96) ? _GPDR(x) : GPDR3)
++#define GPSR(x) ((((x) & 0x7f) < 96) ? _GPSR(x) : GPSR3)
++#define GPCR(x) ((((x) & 0x7f) < 96) ? _GPCR(x) : GPCR3)
++#define GRER(x) ((((x) & 0x7f) < 96) ? _GRER(x) : GRER3)
++#define GFER(x) ((((x) & 0x7f) < 96) ? _GFER(x) : GFER3)
++#define GEDR(x) ((((x) & 0x7f) < 96) ? _GEDR(x) : GEDR3)
++#define GAFR(x) ((((x) & 0x7f) < 96) ? _GAFR(x) : \
++ ((((x) & 0x7f) < 112) ? GAFR3_L : GAFR3_U))
++#else
++
+ #define GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
+ #define GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
+ #define GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
+@@ -840,6 +962,8 @@
+ #define GEDR(x) __REG2(0x40E00048, ((x) & 0x60) >> 3)
+ #define GAFR(x) __REG2(0x40E00054, ((x) & 0x70) >> 2)
+
++#endif
++
+ /* GPIO alternate function assignments */
+
+ #define GPIO1_RST 1 /* reset */
+@@ -1038,6 +1162,8 @@
+ #define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT)
+ #define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT)
+
++#define GPIO117_SCL (117 | GPIO_ALT_FN_1_OUT)
++#define GPIO118_SDA (118 | GPIO_ALT_FN_1_OUT)
+
+ /*
+ * Power Manager
+@@ -1054,8 +1180,62 @@
+ #define PGSR0 __REG(0x40F00020) /* Power Manager GPIO Sleep State Register for GP[31-0] */
+ #define PGSR1 __REG(0x40F00024) /* Power Manager GPIO Sleep State Register for GP[63-32] */
+ #define PGSR2 __REG(0x40F00028) /* Power Manager GPIO Sleep State Register for GP[84-64] */
++#define PGSR3 __REG(0x40F0002C) /* Power Manager GPIO Sleep State Register for GP[118-96] */
+ #define RCSR __REG(0x40F00030) /* Reset Controller Status Register */
+
++#define PSLR __REG(0x40F00034) /* Power Manager Sleep Config Register */
++#define PSTR __REG(0x40F00038) /* Power Manager Standby Config Register */
++#define PSNR __REG(0x40F0003C) /* Power Manager Sense Config Register */
++#define PVCR __REG(0x40F00040) /* Power Manager VoltageControl Register */
++#define PKWR __REG(0x40F00050) /* Power Manager KB Wake-up Enable Reg */
++#define PKSR __REG(0x40F00054) /* Power Manager KB Level-Detect Register */
++#define PCMD(x) __REG(0x40F00080 + x*4)
++#define PCMD0 __REG(0x40F00080 + 0 * 4)
++#define PCMD1 __REG(0x40F00080 + 1 * 4)
++#define PCMD2 __REG(0x40F00080 + 2 * 4)
++#define PCMD3 __REG(0x40F00080 + 3 * 4)
++#define PCMD4 __REG(0x40F00080 + 4 * 4)
++#define PCMD5 __REG(0x40F00080 + 5 * 4)
++#define PCMD6 __REG(0x40F00080 + 6 * 4)
++#define PCMD7 __REG(0x40F00080 + 7 * 4)
++#define PCMD8 __REG(0x40F00080 + 8 * 4)
++#define PCMD9 __REG(0x40F00080 + 9 * 4)
++#define PCMD10 __REG(0x40F00080 + 10 * 4)
++#define PCMD11 __REG(0x40F00080 + 11 * 4)
++#define PCMD12 __REG(0x40F00080 + 12 * 4)
++#define PCMD13 __REG(0x40F00080 + 13 * 4)
++#define PCMD14 __REG(0x40F00080 + 14 * 4)
++#define PCMD15 __REG(0x40F00080 + 15 * 4)
++#define PCMD16 __REG(0x40F00080 + 16 * 4)
++#define PCMD17 __REG(0x40F00080 + 17 * 4)
++#define PCMD18 __REG(0x40F00080 + 18 * 4)
++#define PCMD19 __REG(0x40F00080 + 19 * 4)
++#define PCMD20 __REG(0x40F00080 + 20 * 4)
++#define PCMD21 __REG(0x40F00080 + 21 * 4)
++#define PCMD22 __REG(0x40F00080 + 22 * 4)
++#define PCMD23 __REG(0x40F00080 + 23 * 4)
++#define PCMD24 __REG(0x40F00080 + 24 * 4)
++#define PCMD25 __REG(0x40F00080 + 25 * 4)
++#define PCMD26 __REG(0x40F00080 + 26 * 4)
++#define PCMD27 __REG(0x40F00080 + 27 * 4)
++#define PCMD28 __REG(0x40F00080 + 28 * 4)
++#define PCMD29 __REG(0x40F00080 + 29 * 4)
++#define PCMD30 __REG(0x40F00080 + 30 * 4)
++#define PCMD31 __REG(0x40F00080 + 31 * 4)
++
++#define PCMD_MBC (1<<12)
++#define PCMD_DCE (1<<11)
++#define PCMD_LC (1<<10)
++/* FIXME: PCMD_SQC need be checked. */
++#define PCMD_SQC (3<<8) /* currently only bit 8 is changerable, */
++ /* bit 9 should be 0 all day. */
++#define PVCR_VCSA (0x1<<14)
++#define PVCR_CommandDelay (0xf80)
++/* define MACRO for Power Manager General Configuration Register (PCFR) */
++#define PCFR_FVC (0x1 << 10)
++#define PCFR_PI2C_EN (0x1 << 6)
++
++#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */
+ #define PSSR_RDH (1 << 5) /* Read Disable Hold */
+ #define PSSR_PH (1 << 4) /* Peripheral Control Hold */
+ #define PSSR_VFS (1 << 2) /* VDD Fault Status */
+@@ -1117,14 +1297,29 @@
+ #define OSCC __REG(0x41300008) /* Oscillator Configuration Register */
+
+ #define CCCR_N_MASK 0x0380 /* Run Mode Frequency to Turbo Mode Frequency Multiplier */
++#if !defined(CONFIG_PXA27X)
+ #define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */
++#endif
+ #define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */
+
++#define CKEN24_CAMERA (1 << 24) /* Camera Interface Clock Enable */
++#define CKEN23_SSP1 (1 << 23) /* SSP1 Unit Clock Enable */
++#define CKEN22_MEMC (1 << 22) /* Memory Controller Clock Enable */
++#define CKEN21_MEMSTK (1 << 21) /* Memory Stick Host Controller */
++#define CKEN20_IM (1 << 20) /* Internal Memory Clock Enable */
++#define CKEN19_KEYPAD (1 << 19) /* Keypad Interface Clock Enable */
++#define CKEN18_USIM (1 << 18) /* USIM Unit Clock Enable */
++#define CKEN17_MSL (1 << 17) /* MSL Unit Clock Enable */
+ #define CKEN16_LCD (1 << 16) /* LCD Unit Clock Enable */
++#define CKEN15_PWRI2C (1 << 15) /* PWR I2C Unit Clock Enable */
+ #define CKEN14_I2C (1 << 14) /* I2C Unit Clock Enable */
+ #define CKEN13_FICP (1 << 13) /* FICP Unit Clock Enable */
+ #define CKEN12_MMC (1 << 12) /* MMC Unit Clock Enable */
+ #define CKEN11_USB (1 << 11) /* USB Unit Clock Enable */
++#if defined(CONFIG_PXA27X)
++#define CKEN10_USBHOST (1 << 10) /* USB Host Unit Clock Enable */
++#define CKEN24_CAMERA (1 << 24) /* Camera Unit Clock Enable */
++#endif
+ #define CKEN8_I2S (1 << 8) /* I2S Unit Clock Enable */
+ #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */
+ #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */
+@@ -1137,6 +1332,7 @@
+ #define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */
+ #define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */
+
++#if !defined(CONFIG_PXA27X)
+ #define CCCR_L09 (0x1F)
+ #define CCCR_L27 (0x1)
+ #define CCCR_L32 (0x2)
+@@ -1153,6 +1349,7 @@
+ #define CCCR_N20 (0x4 << 7)
+ #define CCCR_N25 (0x5 << 7)
+ #define CCCR_N30 (0x6 << 7)
++#endif
+
+ /*
+ * LCD
+@@ -1164,7 +1361,8 @@
+ #define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */
+ #define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */
+ #define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */
+-#define LCSR __REG(0x44000038) /* LCD Controller Status Register */
++#define LCSR0 __REG(0x44000038) /* LCD Controller Status Register */
++#define LCSR1 __REG(0x44000034) /* LCD Controller Status Register */
+ #define LIIDR __REG(0x4400003C) /* LCD Controller Interrupt ID Register */
+ #define TMEDRGBR __REG(0x44000040) /* TMED RGB Seed Register */
+ #define TMEDCR __REG(0x44000044) /* TMED Control Register */
+@@ -1194,6 +1392,11 @@
+ #define LCCR0_PDD_S 12
+ #define LCCR0_BM (1 << 20) /* Branch mask */
+ #define LCCR0_OUM (1 << 21) /* Output FIFO underrun mask */
++#if defined(CONFIG_PXA27X)
++#define LCCR0_LCDT (1 << 22) /* LCD Panel Type */
++#define LCCR0_RDSTM (1 << 23) /* Read Status Interrupt Mask */
++#define LCCR0_CMDIM (1 << 24) /* Command Interrupt Mask */
++#endif
+
+ #define LCCR1_PPL Fld (10, 0) /* Pixels Per Line - 1 */
+ #define LCCR1_DisWdth(Pixel) /* Display Width [1..800 pix.] */ \
+@@ -1257,6 +1460,11 @@
+ #endif
+ #define LCCR3_DPC (1 << 27) /* double pixel clock mode */
+
++#define LCCR3_PDFOR_0 (0 << 30)
++#define LCCR3_PDFOR_1 (1 << 30)
++#define LCCR3_PDFOR_2 (2 << 30)
++#define LCCR3_PDFOR_3 (3 << 30)
++
+
+ #define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */
+ #define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor */ \
+@@ -1265,7 +1473,7 @@
+
+ #define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */
+ #define LCCR3_Bpp(Bpp) /* Bit Per Pixel */ \
+- (((Bpp) << FShft (LCCR3_BPP)))
++ ((((Bpp&0x7) << FShft (LCCR3_BPP)))|(((Bpp&0x8)<<26)))
+
+ #define LCCR3_ACB Fld (8, 8) /* AC Bias */
+ #define LCCR3_Acb(Acb) /* BAC Bias */ \
+@@ -1280,33 +1488,50 @@
+ #define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */
+ /* active Low */
+
+-#define LCSR_LDD (1 << 0) /* LCD Disable Done */
+-#define LCSR_SOF (1 << 1) /* Start of frame */
+-#define LCSR_BER (1 << 2) /* Bus error */
+-#define LCSR_ABC (1 << 3) /* AC Bias count */
+-#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */
+-#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */
+-#define LCSR_OU (1 << 6) /* output FIFO underrun */
+-#define LCSR_QD (1 << 7) /* quick disable */
+-#define LCSR_EOF (1 << 8) /* end of frame */
+-#define LCSR_BS (1 << 9) /* branch status */
+-#define LCSR_SINT (1 << 10) /* subsequent interrupt */
+-
+-#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */
+-
+-#define LCSR_LDD (1 << 0) /* LCD Disable Done */
+-#define LCSR_SOF (1 << 1) /* Start of frame */
+-#define LCSR_BER (1 << 2) /* Bus error */
+-#define LCSR_ABC (1 << 3) /* AC Bias count */
+-#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */
+-#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */
+-#define LCSR_OU (1 << 6) /* output FIFO underrun */
+-#define LCSR_QD (1 << 7) /* quick disable */
+-#define LCSR_EOF (1 << 8) /* end of frame */
+-#define LCSR_BS (1 << 9) /* branch status */
+-#define LCSR_SINT (1 << 10) /* subsequent interrupt */
++#define LCSR0_LDD (1 << 0) /* LCD Disable Done */
++#define LCSR0_SOF (1 << 1) /* Start of frame */
++#define LCSR0_BER (1 << 2) /* Bus error */
++#define LCSR0_ABC (1 << 3) /* AC Bias count */
++#define LCSR0_IUL (1 << 4) /* input FIFO underrun Lower panel */
++#define LCSR0_IUU (1 << 5) /* input FIFO underrun Upper panel */
++#define LCSR0_OU (1 << 6) /* output FIFO underrun */
++#define LCSR0_QD (1 << 7) /* quick disable */
++#define LCSR0_EOF0 (1 << 8) /* end of frame */
++#define LCSR0_BS (1 << 9) /* branch status */
++#define LCSR0_SINT (1 << 10) /* subsequent interrupt */
++
++#define LCSR1_SOF1 (1 << 0)
++#define LCSR1_SOF2 (1 << 1)
++#define LCSR1_SOF3 (1 << 2)
++#define LCSR1_SOF4 (1 << 3)
++#define LCSR1_SOF5 (1 << 4)
++#define LCSR1_SOF6 (1 << 5)
++
++#define LCSR1_EOF1 (1 << 8)
++#define LCSR1_EOF2 (1 << 9)
++#define LCSR1_EOF3 (1 << 10)
++#define LCSR1_EOF4 (1 << 11)
++#define LCSR1_EOF5 (1 << 12)
++#define LCSR1_EOF6 (1 << 13)
++
++#define LCSR1_BS1 (1 << 16)
++#define LCSR1_BS2 (1 << 17)
++#define LCSR1_BS3 (1 << 18)
++#define LCSR1_BS4 (1 << 19)
++#define LCSR1_BS5 (1 << 20)
++#define LCSR1_BS6 (1 << 21)
++
++#define LCSR1_IU2 (1 << 25)
++#define LCSR1_IU3 (1 << 26)
++#define LCSR1_IU4 (1 << 27)
++#define LCSR1_IU5 (1 << 28)
++#define LCSR1_IU6 (1 << 29)
+
+ #define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */
++#if defined(CONFIG_PXA27X)
++#define LDCMD_SOFINT (1 << 22)
++#define LDCMD_EOFINT (1 << 21)
++#endif
+
+ /*
+ * Memory controller
+@@ -1369,5 +1594,191 @@
+ #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */
+ #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */
+
++#if defined(CONFIG_PXA27X)
+
+-#endif
++#define ARB_CNTRL __REG(0x48000048) /* Arbiter Control Register */
++
++#define ARB_DMA_SLV_PARK (1<<31) /* Be parked with DMA slave when idle */
++#define ARB_CI_PARK (1<<30) /* Be parked with Camera Interface when idle */
++#define ARB_EX_MEM_PARK (1<<29) /* Be parked with external MEMC when idle */
++#define ARB_INT_MEM_PARK (1<<28) /* Be parked with internal MEMC when idle */
++#define ARB_USB_PARK (1<<27) /* Be parked with USB when idle */
++#define ARB_LCD_PARK (1<<26) /* Be parked with LCD when idle */
++#define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */
++#define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */
++#define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */
++
++/* Interrupt Controller */
++
++#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
++#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
++#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
++#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
++#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
++
++/* General Purpose I/O */
++
++#define GAFR3_L __REG(0x40E0006C) /* GPIO Alternate Function Select Register GPIO<111:96> */
++#define GAFR3_U __REG(0x40E00070) /* GPIO Alternate Function Select Register GPIO<127:112> */
++#define GPLR3 __REG(0x40E00100) /* GPIO Pin-Level Register GPIO<127:96> */
++#define GPDR3 __REG(0x40E0010C) /* GPIO Pin Direction Register GPIO<127:96> */
++#define GPSR3 __REG(0x40E00118) /* GPIO Pin Output Set Register GPIO<127:96> */
++#define GPCR3 __REG(0x40E00124) /* GPIO Pin Output Clear Register GPIO <127:96> */
++#define GRER3 __REG(0x40E00130) /* GPIO Rising-Edge Detect Register GPIO<127:96> */
++#define GFER3 __REG(0x40E0013C) /* GPIO Falling-Edge Detect Register GPIO<31:0> */
++#define GEDR3 __REG(0x40E00148) /* GPIO Edge Detect Status Register GPIO<127:96> */
++
++/* Core Clock */
++
++#define CCSR __REG(0x4130000C) /* Core Clock Status Register */
++
++#define CKEN23_SSP1 (1 << 23) /* SSP1 Unit Clock Enable */
++#define CKEN22_MEMC (1 << 22) /* Memory Controler */
++#define CKEN21_MSHC (1 << 21) /* Memery Stick Host Controller */
++#define CKEN20_IM (1 << 20) /* Internal Memory Clock Enable */
++#define CKEN19_KEYPAD (1 << 19) /* Keypad Interface Clock Enable */
++#define CKEN18_USIM (1 << 18) /* USIM Unit Clock Enable */
++#define CKEN17_MSL (1 << 17) /* MSL Interface Unit Clock Enable */
++#define CKEN15_PWR_I2C (1 << 15) /* PWR_I2C Unit Clock Enable */
++#define CKEN9_OST (1 << 9) /* OS Timer Unit Clock Enable */
++#define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */
++
++/* Memory controller */
++
++#define MDREFR_K0DB4 (1 << 29) /* SDCLK[0] divide by 4 */
++
++/* LCD registers */
++#define LCCR4 __REG(0x44000010) /* LCD Controller Control Register 4 */
++#define LCCR5 __REG(0x44000014) /* LCD Controller Control Register 5 */
++#define FBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */
++#define FBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */
++#define FBR2 __REG(0x44000028) /* DMA Channel 2 Frame Branch Register */
++#define FBR3 __REG(0x4400002C) /* DMA Channel 3 Frame Branch Register */
++#define FBR4 __REG(0x44000030) /* DMA Channel 4 Frame Branch Register */
++#define FDADR2 __REG(0x44000220) /* DMA Channel 2 Frame Descriptor Address Register */
++#define FSADR2 __REG(0x44000224) /* DMA Channel 2 Frame Source Address Register */
++#define FIDR2 __REG(0x44000228) /* DMA Channel 2 Frame ID Register */
++#define LDCMD2 __REG(0x4400022C) /* DMA Channel 2 Command Register */
++#define FDADR3 __REG(0x44000230) /* DMA Channel 3 Frame Descriptor Address Register */
++#define FSADR3 __REG(0x44000234) /* DMA Channel 3 Frame Source Address Register */
++#define FIDR3 __REG(0x44000238) /* DMA Channel 3 Frame ID Register */
++#define LDCMD3 __REG(0x4400023C) /* DMA Channel 3 Command Register */
++#define FDADR4 __REG(0x44000240) /* DMA Channel 4 Frame Descriptor Address Register */
++#define FSADR4 __REG(0x44000244) /* DMA Channel 4 Frame Source Address Register */
++#define FIDR4 __REG(0x44000248) /* DMA Channel 4 Frame ID Register */
++#define LDCMD4 __REG(0x4400024C) /* DMA Channel 4 Command Register */
++#define FDADR5 __REG(0x44000250) /* DMA Channel 5 Frame Descriptor Address Register */
++#define FSADR5 __REG(0x44000254) /* DMA Channel 5 Frame Source Address Register */
++#define FIDR5 __REG(0x44000258) /* DMA Channel 5 Frame ID Register */
++#define LDCMD5 __REG(0x4400025C) /* DMA Channel 5 Command Register */
++
++#define OVL1C1 __REG(0x44000050) /* Overlay 1 Control Register 1 */
++#define OVL1C2 __REG(0x44000060) /* Overlay 1 Control Register 2 */
++#define OVL2C1 __REG(0x44000070) /* Overlay 2 Control Register 1 */
++#define OVL2C2 __REG(0x44000080) /* Overlay 2 Control Register 2 */
++#define CCR __REG(0x44000090) /* Cursor Control Register */
++
++#define FBR5 __REG(0x44000110) /* DMA Channel 5 Frame Branch Register */
++#define FBR6 __REG(0x44000114) /* DMA Channel 6 Frame Branch Register */
++
++#define LCCR0_LDDALT (1<<26) /* LDD Alternate mapping bit when base pixel is RGBT16 */
++#define LCCR0_OUC (1<<25) /* Overlay Underlay Control Bit */
++
++#define LCCR5_SOFM1 (1<<0) /* Start Of Frame Mask for Overlay 1 (channel 1) */
++#define LCCR5_SOFM2 (1<<1) /* Start Of Frame Mask for Overlay 2 (channel 2) */
++#define LCCR5_SOFM3 (1<<2) /* Start Of Frame Mask for Overlay 2 (channel 3) */
++#define LCCR5_SOFM4 (1<<3) /* Start Of Frame Mask for Overlay 2 (channel 4) */
++#define LCCR5_SOFM5 (1<<4) /* Start Of Frame Mask for cursor (channel 5) */
++#define LCCR5_SOFM6 (1<<5) /* Start Of Frame Mask for command data (channel 6) */
++
++#define LCCR5_EOFM1 (1<<8) /* End Of Frame Mask for Overlay 1 (channel 1) */
++#define LCCR5_EOFM2 (1<<9) /* End Of Frame Mask for Overlay 2 (channel 2) */
++#define LCCR5_EOFM3 (1<<10) /* End Of Frame Mask for Overlay 2 (channel 3) */
++#define LCCR5_EOFM4 (1<<11) /* End Of Frame Mask for Overlay 2 (channel 4) */
++#define LCCR5_EOFM5 (1<<12) /* End Of Frame Mask for cursor (channel 5) */
++#define LCCR5_EOFM6 (1<<13) /* End Of Frame Mask for command data (channel 6) */
++
++#define LCCR5_BSM1 (1<<16) /* Branch mask for Overlay 1 (channel 1) */
++#define LCCR5_BSM2 (1<<17) /* Branch mask for Overlay 2 (channel 2) */
++#define LCCR5_BSM3 (1<<18) /* Branch mask for Overlay 2 (channel 3) */
++#define LCCR5_BSM4 (1<<19) /* Branch mask for Overlay 2 (channel 4) */
++#define LCCR5_BSM5 (1<<20) /* Branch mask for cursor (channel 5) */
++#define LCCR5_BSM6 (1<<21) /* Branch mask for data command (channel 6) */
++
++#define LCCR5_IUM1 (1<<24) /* Input FIFO Underrun Mask for Overlay 1 */
++#define LCCR5_IUM2 (1<<25) /* Input FIFO Underrun Mask for Overlay 2 */
++#define LCCR5_IUM3 (1<<26) /* Input FIFO Underrun Mask for Overlay 2 */
++#define LCCR5_IUM4 (1<<27) /* Input FIFO Underrun Mask for Overlay 2 */
++#define LCCR5_IUM5 (1<<28) /* Input FIFO Underrun Mask for cursor */
++#define LCCR5_IUM6 (1<<29) /* Input FIFO Underrun Mask for data command */
++
++#define OVL1C1_O1EN (1<<31) /* Enable bit for Overlay 1 */
++#define OVL2C1_O2EN (1<<31) /* Enable bit for Overlay 2 */
++#define CCR_CEN (1<<31) /* Enable bit for Cursor */
++
++/* Keypad controller */
++
++#define KPC __REG(0x41500000) /* Keypad Interface Control register */
++#define KPDK __REG(0x41500008) /* Keypad Interface Direct Key register */
++#define KPREC __REG(0x41500010) /* Keypad Intefcace Rotary Encoder register */
++#define KPMK __REG(0x41500018) /* Keypad Intefcace Matrix Key register */
++#define KPAS __REG(0x41500020) /* Keypad Interface Automatic Scan register */
++#define KPASMKP0 __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
++#define KPASMKP1 __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
++#define KPASMKP2 __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
++#define KPASMKP3 __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
++#define KPKDI __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
++
++#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
++#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
++#define KPC_MI (0x1 << 22) /* Matrix interrupt bit */
++#define KPC_IMKP (0x1 << 21) /* Ignore Multiple Key Press */
++#define KPC_MS7 (0x1 << 20) /* Matrix scan line 7 */
++#define KPC_MS6 (0x1 << 19) /* Matrix scan line 6 */
++#define KPC_MS5 (0x1 << 18) /* Matrix scan line 5 */
++#define KPC_MS4 (0x1 << 17) /* Matrix scan line 4 */
++#define KPC_MS3 (0x1 << 16) /* Matrix scan line 3 */
++#define KPC_MS2 (0x1 << 15) /* Matrix scan line 2 */
++#define KPC_MS1 (0x1 << 14) /* Matrix scan line 1 */
++#define KPC_MS0 (0x1 << 13) /* Matrix scan line 0 */
++#define KPC_ME (0x1 << 12) /* Matrix Keypad Enable */
++#define KPC_MIE (0x1 << 11) /* Matrix Interrupt Enable */
++#define KPC_DK_DEB_SEL (0x1 << 9) /* Direct Key Debounce select */
++#define KPC_DI (0x1 << 5) /* Direct key interrupt bit */
++#define KPC_DEE0 (0x1 << 2) /* Rotary Encoder 0 Enable */
++#define KPC_DE (0x1 << 1) /* Direct Keypad Enable */
++#define KPC_DIE (0x1 << 0) /* Direct Keypad interrupt Enable */
++
++#define KPDK_DKP (0x1 << 31)
++#define KPDK_DK7 (0x1 << 7)
++#define KPDK_DK6 (0x1 << 6)
++#define KPDK_DK5 (0x1 << 5)
++#define KPDK_DK4 (0x1 << 4)
++#define KPDK_DK3 (0x1 << 3)
++#define KPDK_DK2 (0x1 << 2)
++#define KPDK_DK1 (0x1 << 1)
++#define KPDK_DK0 (0x1 << 0)
++
++#define KPREC_OF1 (0x1 << 31)
++#define kPREC_UF1 (0x1 << 30)
++#define KPREC_OF0 (0x1 << 15)
++#define KPREC_UF0 (0x1 << 14)
++
++#define KPMK_MKP (0x1 << 31)
++#define KPAS_SO (0x1 << 31)
++#define KPASMKPx_SO (0x1 << 31)
++
++#define GPIO113_BIT (1 << 17)/* GPIO113 in GPSR, GPCR, bit 17 */
++#define PSLR __REG(0x40F00034)
++#define PSTR __REG(0x40F00038) /* Power Manager Standby Configuration Reg */
++#define PSNR __REG(0x40F0003C) /* Power Manager Sense Configuration Reg */
++#define PVCR __REG(0x40F00040) /* Power Manager Voltage Change Control Reg */
++#define PKWR __REG(0x40F00050) /* Power Manager KB Wake-Up Enable Reg */
++#define PKSR __REG(0x40F00054) /* Power Manager KB Level-Detect Status Reg */
++#define OSMR4 __REG(0x40A00080) /* */
++#define OSCR4 __REG(0x40A00040) /* OS Timer Counter Register */
++#define OMCR4 __REG(0x40A000C0) /* */
++
++#endif /* CONFIG_PXA27X */
++
++#endif /* _PXA_REGS_H_ */
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/mach-types.h u-boot-1.1.2-neon/include/asm-arm/mach-types.h
+--- u-boot-1.1.2/include/asm-arm/mach-types.h 2004-10-10 20:41:14.000000000 +0200
++++ u-boot-1.1.2-neon/include/asm-arm/mach-types.h 2007-08-11 21:07:21.000000000 +0200
+@@ -624,6 +624,9 @@
+ #define MACH_TYPE_RMS100 611
+ #define MACH_TYPE_KB9200 612
+ #define MACH_TYPE_SX1 613
++#define MACH_TYPE_NEON 332
++#define MACH_TYPE_BD2003 332
++#define MACH_TYPE_HALOGEN 332
+
+ #ifdef CONFIG_ARCH_EBSA110
+ # ifdef machine_arch_type
+@@ -7945,6 +7948,42 @@
+ # define machine_is_sx1() (0)
+ #endif
+
++#ifdef CONFIG_ARCH_NEON
++# ifdef machine_arch_type
++# undef machine_arch_type
++# define machine_arch_type __machine_arch_type
++# else
++# define machine_arch_type MACH_TYPE_NEON
++# endif
++# define machine_is_neon() (machine_arch_type == MACH_TYPE_NEON)
++#else
++# define machine_is_neon() (0)
++#endif
++
++#ifdef CONFIG_ARCH_BD2003
++# ifdef machine_arch_type
++# undef machine_arch_type
++# define machine_arch_type __machine_arch_type
++# else
++# define machine_arch_type MACH_TYPE_BD2003
++# endif
++# define machine_is_bd2003() (machine_arch_type == MACH_TYPE_BD2003)
++#else
++# define machine_is_bd2003() (0)
++#endif
++
++#ifdef CONFIG_ARCH_HALOGEN
++# ifdef machine_arch_type
++# undef machine_arch_type
++# define machine_arch_type __machine_arch_type
++# else
++# define machine_arch_type MACH_TYPE_HALOGEN
++# endif
++# define machine_is_halogen() (machine_arch_type == MACH_TYPE_HALOGEN)
++#else
++# define machine_is_halogen() (0)
++#endif
++
+ /*
+ * These have not yet been registered
+ */
+diff -u -r --new-file u-boot-1.1.2/include/asm-arm/processor.h u-boot-1.1.2-neon/include/asm-arm/processor.h
+--- u-boot-1.1.2/include/asm-arm/processor.h 2003-06-26 00:26:36.000000000 +0200
++++ u-boot-1.1.2-neon/include/asm-arm/processor.h 2007-08-11 21:07:21.000000000 +0200
+@@ -48,11 +48,22 @@
+ #include <asm/proc/processor.h>
+ #include <asm/types.h>
+
++#ifdef arm
++#warning arm defined by preprocessor
++#define armX arm
++#undef arm
++#endif
++
+ union debug_insn {
+ u32 arm;
+ u16 thumb;
+ };
+
++#ifdef armX
++#define arm
++#undef armX
++#endif
++
+ struct debug_entry {
+ u32 address;
+ union debug_insn insn;
+diff -u -r --new-file u-boot-1.1.2/include/cmd_confdefs.h u-boot-1.1.2-neon/include/cmd_confdefs.h
+--- u-boot-1.1.2/include/cmd_confdefs.h 2004-12-16 18:59:53.000000000 +0100
++++ u-boot-1.1.2-neon/include/cmd_confdefs.h 2007-08-11 21:07:21.000000000 +0200
+@@ -92,6 +92,8 @@
+ #define CFG_CMD_XIMG 0x0400000000000000ULL /* Load part of Multi Image */
+ #define CFG_CMD_UNIVERSE 0x0800000000000000ULL /* Tundra Universe Support */
+ #define CFG_CMD_EXT2 0x1000000000000000ULL /* EXT2 Support */
++#define CFG_CMD_LCDPANEL 0x2000000000000000ULL /* Dynamic LCD Panel Support */
++#define CFG_CMD_NOT 0x4000000000000000ULL /* Negate a command */
+
+ #define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFULL /* ALL commands */
+
+diff -u -r --new-file u-boot-1.1.2/include/configs/bd2003.h u-boot-1.1.2-neon/include/configs/bd2003.h
+--- u-boot-1.1.2/include/configs/bd2003.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/configs/bd2003.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,315 @@
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * bd2003.h
++ *
++ * This header file declares the configuration constants for the Boundary
++ * Devices BD2003 board.
++ *
++ * Change History :
++ *
++ * $Log: bd2003.h,v $
++ * Revision 1.7 2005/07/18 01:51:59 tkisky
++ * -define display types
++ *
++ * Revision 1.6 2005/07/17 22:52:10 ericn
++ * -fix comment
++ *
++ * Revision 1.5 2005/07/17 22:36:37 ericn
++ * -merge w/boundaryLib
++ *
++ * Revision 1.4 2005/07/02 18:45:55 ericn
++ * -bring up-to-date
++ *
++ * Revision 1.3 2005/04/20 09:05:36 tkisky
++ * -include select.h
++ *
++ * Revision 1.2 2005/04/15 10:40:52 tkisky
++ * -remove LCD_XRES,LCD_YRES
++ *
++ * Revision 1.1 2005/04/09 17:49:24 ericn
++ * -Initial import
++ *
++ *
++ * 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
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++/*
++ * If we are developing, we might want to start armboot from ram
++ * so we MUST NOT initialize critical regs like mem-timing ...
++ */
++#include "select.h"
++
++#define CONFIG_INIT_CRITICAL /* undef for developing */
++#define CONFIG_SETUP_MEMORY_TAGS 1
++#define CONFIG_INITRD_TAG 1
++
++/*
++ * High Level Configuration Options
++ * (easy to change)
++ */
++#define CONFIG_PXA250 1 /* This is an PXA250 CPU */
++#define PXALCD 1 /* Using the PXA display controller */
++#define CONFIG_LCD 1
++
++#define CONFIG_MMC 1
++#define BOARD_LATE_INIT 1
++
++#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
++
++/*
++ * Size of malloc() pool
++ */
++#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
++#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
++#define CFG_MMU_SPACE_RESERVED (1<<14)
++
++/*
++ * Hardware drivers
++ */
++#define CONFIG_DRIVER_SMC91111
++#define CONFIG_SMC91111_BASE 0x10000300
++#define CONFIG_SMC_USE_32_BIT
++
++/*
++ * select serial console configuration
++ */
++#define CONFIG_FFUART 1 /* we use FFUART on BD2003 */
++
++/* allow to overwrite serial and ethaddr */
++//#define CONFIG_ENV_OVERWRITE
++
++#define CONFIG_BAUDRATE 115200
++
++#define SKIP_COMMANDS ( CFG_CMD_MISC \
++ | CFG_CMD_BDI \
++ | CFG_CMD_BOOTD \
++ | CFG_CMD_LOADS \
++ | CFG_CMD_LOADB \
++ | CFG_CMD_ITEST \
++ | CFG_CMD_FPGA \
++ | CFG_CMD_ECHO \
++ | CFG_CMD_DIAG \
++ | CFG_CMD_DATE \
++ | CFG_CMD_BOOTP \
++ | CFG_CMD_NFS \
++ )
++// | CFG_CMD_FLASH
++// | CFG_CMD_DHCP
++// | CFG_CMD_NET
++// | CFG_CMD_MEMORY
++// | CFG_CMD_ENV
++
++#define CONFIG_COMMANDS ( (CONFIG_CMD_DFL \
++ | CFG_CMD_MMC \
++ | CFG_CMD_FAT \
++ | CFG_CMD_LCDPANEL \
++ | CFG_CMD_FLASH \
++ | CFG_CMD_DHCP \
++ | CFG_CMD_ENV \
++ | CFG_CMD_BMP) & ~(SKIP_COMMANDS) )
++
++/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
++#include <cmd_confdefs.h>
++#define CONFIG_BOOTDELAY 3
++#define CONFIG_BOOTCOMMAND "mmcinit; " \
++ "fatload mmc 0 a0000000 init.scr ; autoscr a0000000 ; "
++#define CONFIG_BOOTARGS "console=ttyS0,115200 DEBUG=1 ENV=/etc/bashrc init=/linuxrc rw mtdparts=phys:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs"
++#define CONFIG_CMDLINE_TAG
++
++#define CONFIG_GZIP
++
++/*
++ * Choose one of the following:
++ *
++ * hitachi_qvga
++ * sharp_qvga
++ * hitachi_hvga
++ * sharp_vga
++ * hitachi_wvga - 7 or 9 inch
++ */
++#ifndef DA320X240
++#define DA320X240 0
++#define DA640X240 1
++#define DA800X480 2
++#define DA640X480 3
++#define DA240X320 4
++#define DA800X600 5
++#define DA1024X768 6
++#define DP480X320 7
++#define DP320X240 8
++#define DL122X32 9
++#endif
++
++#if DISPLAY_TYPE == DA640X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_hvga" "\0"
++#elif DISPLAY_TYPE == DA240X320
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=qvga_portrait" "\0"
++#elif DISPLAY_TYPE == DA320X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_qvga" "\0"
++#elif DISPLAY_TYPE == DA8000X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA640X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=sharp_vga" "\0"
++#elif DISPLAY_TYPE == DA800X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA1024X768
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=crt1024x768" "\0"
++#else
++#error No display selected
++#endif
++
++#define LCD_BPP LCD_COLOR8
++
++
++#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
++#define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
++#endif
++
++/*
++ * Miscellaneous configurable options
++ */
++#define CFG_HUSH_PARSER 1
++#define CFG_PROMPT_HUSH_PS2 "> "
++
++#define CFG_LONGHELP /* undef to save memory */
++#ifdef CFG_HUSH_PARSER
++#define CFG_PROMPT "$ " /* Monitor Command Prompt */
++#else
++#define CFG_PROMPT "=> " /* Monitor Command Prompt */
++#endif
++#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
++#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
++#define CFG_MAXARGS 16 /* max number of command args */
++#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
++#define CFG_DEVICE_NULLDEV 1
++
++#define CFG_MEMTEST_START 0xa0400000 /* memtest works on */
++#define CFG_MEMTEST_END 0xa0800000 /* 4 ... 8 MB in DRAM */
++
++#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
++
++#define CFG_LOAD_ADDR 0xa0030000 /* default load address */
++
++#define CFG_HZ 3686400 /* incrementer freq: 3.6864 MHz */
++#define CFG_CPUSPEED 0x161 /* set core clock to 400/200/100 MHz */
++
++ /* valid baudrates */
++#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
++#define CFG_MMC_BASE 0xF0000000
++
++/*
++ * Stack sizes
++ *
++ * The stack sizes are set up in start.S using the settings below
++ */
++#define CONFIG_STACKSIZE (128*1024) /* regular stack */
++#ifdef CONFIG_USE_IRQ
++#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
++#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
++#endif
++
++/*
++ * Physical Memory Map
++ */
++#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
++#define PHYS_SDRAM_1 0xa0000000 /* SDRAM Bank #1 */
++#define PHYS_SDRAM_1_SIZE 0x02000000 /* 32 MB */
++
++#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
++#define PHYS_FLASH_2 0x04000000 /* Flash Bank #2 */
++#define PHYS_FLASH_SIZE 0x02000000 /* 32 MB */
++#define PHYS_FLASH_BANK_SIZE 0x02000000 /* 32 MB Banks */
++#define PHYS_FLASH_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */
++
++#define CFG_DRAM_BASE 0xa0000000
++#define CFG_DRAM_SIZE 0x04000000
++
++
++/*
++ * Memory settings
++ */
++#define CFG_MSC0_VAL 0x23F223F2
++#define CFG_MSC1_VAL 0x3FF1A441
++#define CFG_MSC2_VAL 0x7FF97FF1
++#define CFG_MDCNFG_VAL 0x00001AC9
++#define CFG_MDREFR_VAL 0x00018018
++#define CFG_MDMRS_VAL 0x00000000
++
++/*
++ * FLASH and environment organization
++ */
++#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
++#define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
++
++/* timeout values are in ticks */
++#define CFG_FLASH_ERASE_TOUT (25*CFG_HZ) /* Timeout for Flash Erase */
++#define CFG_FLASH_WRITE_TOUT (25*CFG_HZ) /* Timeout for Flash Write */
++
++/*
++ * Environment is saved in flash at offset 1MB
++ */
++#define CFG_ENV_IS_IN_FLASH 1
++#define CFG_FLASH_BASE 0
++#define CFG_ENV_ADDR ((CFG_FLASH_BASE)+0x100000) /* Addr of Environment Sector */
++#define CFG_ENV_OFFSET ((CFG_ENV_ADDR)-(CFG_FLASH_BASE))
++#define CFG_ENV_SIZE PHYS_FLASH_SECT_SIZE /* Total Size of Environment Sector */
++
++/*
++ * GPIO settings
++ */
++#define CFG_GPSR0_VAL 0x00008000
++#define CFG_GPSR1_VAL 0x00FC0382
++#define CFG_GPSR2_VAL 0x0001FFFF
++#define CFG_GPCR0_VAL 0x00000000
++#define CFG_GPCR1_VAL 0x00000000
++#define CFG_GPCR2_VAL 0x00000000
++#define CFG_GPDR0_VAL 0x0060A800
++#define CFG_GPDR1_VAL 0x00FF0382
++#define CFG_GPDR2_VAL 0x0001C000
++#define CFG_GAFR0_L_VAL 0x98400000
++#define CFG_GAFR0_U_VAL 0x00002950
++#define CFG_GAFR1_L_VAL 0x000A9558
++#define CFG_GAFR1_U_VAL 0x0005AAAA
++#define CFG_GAFR2_L_VAL 0xA0000000
++#define CFG_GAFR2_U_VAL 0x00000002
++
++#define CFG_PSSR_VAL 0x20
++
++/*
++ * PCMCIA and CF Interfaces
++ */
++#define CFG_MECR_VAL 0x00000000
++#define CFG_MCMEM0_VAL 0x00010504
++#define CFG_MCMEM1_VAL 0x00010504
++#define CFG_MCATT0_VAL 0x00010504
++#define CFG_MCATT1_VAL 0x00010504
++#define CFG_MCIO0_VAL 0x00004715
++#define CFG_MCIO1_VAL 0x00004715
++
++#ifndef __ASSEMBLY__
++
++extern unsigned long const fbStart ;
++extern unsigned long paletteRegs ;
++
++#endif /* _ASMLANGUAGE */
++
++#endif
++
+diff -u -r --new-file u-boot-1.1.2/include/configs/.cvsignore u-boot-1.1.2-neon/include/configs/.cvsignore
+--- u-boot-1.1.2/include/configs/.cvsignore 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/configs/.cvsignore 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1 @@
++select.h
+diff -u -r --new-file u-boot-1.1.2/include/configs/halogen.h u-boot-1.1.2-neon/include/configs/halogen.h
+--- u-boot-1.1.2/include/configs/halogen.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/configs/halogen.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,325 @@
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * halogen.h
++ *
++ * This header file declares the configuration constants for the Boundary
++ * Devices Halogen (PXA-270) boards.
++ *
++ * Change History :
++ *
++ * $Log: halogen.h,v $
++ * Revision 1.6 2005/07/18 01:51:59 tkisky
++ * -define display types
++ *
++ * Revision 1.5 2005/07/17 22:52:10 ericn
++ * -fix comment
++ *
++ * Revision 1.4 2005/07/17 22:36:37 ericn
++ * -merge w/boundaryLib
++ *
++ * Revision 1.3 2005/07/16 16:26:00 ericn
++ * -fix name, memsize
++ *
++ * Revision 1.2 2005/07/10 14:32:45 ericn
++ * -include USB
++ *
++ * Revision 1.1 2005/07/04 16:40:32 ericn
++ * -Initial import
++ *
++ *
++ * 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
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++/*
++ * If we are developing, we might want to start armboot from ram
++ * so we MUST NOT initialize critical regs like mem-timing ...
++ */
++#include "select.h"
++
++#define CONFIG_INIT_CRITICAL /* undef for developing */
++#define CONFIG_SETUP_MEMORY_TAGS 1
++#define CONFIG_INITRD_TAG 1
++
++/*
++ * High Level Configuration Options
++ * (easy to change)
++ */
++#define CONFIG_PXA270 1 /* This is a PXA270 CPU */
++#define CONFIG_PXA27X 1 /* Which is a PXA27X */
++
++#define PXALCD 1 /* Using the PXA display controller */
++#define CONFIG_LCD 1
++
++#define CONFIG_MMC 1
++#define BOARD_LATE_INIT 1
++
++#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
++
++/*
++ * Size of malloc() pool
++ */
++#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
++#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
++#define CFG_MMU_SPACE_RESERVED (1<<14)
++
++/*
++ * Hardware drivers
++ */
++#define CONFIG_DRIVER_SMC91111
++#define CONFIG_SMC91111_BASE 0x10000300
++#define CONFIG_SMC_USE_32_BIT
++
++/************************************************************
++ * USB support
++ ************************************************************/
++#define LITTLEENDIAN 1 /* Needed by usb_ohci.c */
++#define CFG_DEVICE_DEREGISTER 1 /* Needed by usb_kbd */
++#define CONFIG_DOS_PARTITION 1
++#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_KEYBOARD 1
++#define CONFIG_USB_STORAGE 1
++
++/*
++ * select serial console configuration
++ */
++#define CONFIG_FFUART 1 /* we use FFUART on HALOGEN */
++
++/* allow to overwrite serial and ethaddr */
++//#define CONFIG_ENV_OVERWRITE
++
++#define CONFIG_BAUDRATE 115200
++
++#define SKIP_COMMANDS ( CFG_CMD_MISC \
++ | CFG_CMD_BDI \
++ | CFG_CMD_BOOTD \
++ | CFG_CMD_LOADS \
++ | CFG_CMD_LOADB \
++ | CFG_CMD_ITEST \
++ | CFG_CMD_FPGA \
++ | CFG_CMD_ECHO \
++ | CFG_CMD_DIAG \
++ | CFG_CMD_DATE \
++ | CFG_CMD_BOOTP \
++ | CFG_CMD_NFS \
++ )
++// | CFG_CMD_FLASH
++// | CFG_CMD_DHCP
++// | CFG_CMD_NET
++// | CFG_CMD_MEMORY
++// | CFG_CMD_ENV
++
++#define CONFIG_COMMANDS ( (CONFIG_CMD_DFL \
++ | CFG_CMD_MMC \
++ | CFG_CMD_FAT \
++ | CFG_CMD_LCDPANEL \
++ | CFG_CMD_FLASH \
++ | CFG_CMD_DHCP \
++ | CFG_CMD_ENV \
++ | CFG_CMD_USB \
++ | CFG_CMD_BMP) & ~(SKIP_COMMANDS) )
++
++/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
++#include <cmd_confdefs.h>
++#define CONFIG_BOOTDELAY 3
++#define CONFIG_BOOTCOMMAND "mmcinit; " \
++ "fatload mmc 0 a0000000 init.scr ; autoscr a0000000 ; "
++#define CONFIG_BOOTARGS "console=ttyS0,115200 DEBUG=1 ENV=/etc/bashrc init=/linuxrc rw mtdparts=phys:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs"
++#define CONFIG_CMDLINE_TAG
++
++#define CONFIG_GZIP
++
++/*
++ * Choose one of the following:
++ *
++ * hitachi_qvga
++ * sharp_qvga
++ * hitachi_hvga
++ * sharp_vga
++ * hitachi_wvga - 7 or 9 inch
++ */
++#ifndef DA320X240
++#define DA320X240 0
++#define DA640X240 1
++#define DA800X480 2
++#define DA640X480 3
++#define DA240X320 4
++#define DA800X600 5
++#define DA1024X768 6
++#define DP480X320 7
++#define DP320X240 8
++#define DL122X32 9
++#endif
++
++#if DISPLAY_TYPE == DA640X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_hvga" "\0"
++#elif DISPLAY_TYPE == DA240X320
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=qvga_portrait" "\0"
++#elif DISPLAY_TYPE == DA320X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_qvga" "\0"
++#elif DISPLAY_TYPE == DA8000X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA640X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=sharp_vga" "\0"
++#elif DISPLAY_TYPE == DA800X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA1024X768
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=crt1024x768" "\0"
++#else
++#error No display selected
++#endif
++
++#define LCD_BPP LCD_COLOR8
++
++
++#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
++#define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
++#endif
++
++/*
++ * Miscellaneous configurable options
++ */
++#define CFG_HUSH_PARSER 1
++#define CFG_PROMPT_HUSH_PS2 "> "
++
++#define CFG_LONGHELP /* undef to save memory */
++#ifdef CFG_HUSH_PARSER
++#define CFG_PROMPT "$ " /* Monitor Command Prompt */
++#else
++#define CFG_PROMPT "=> " /* Monitor Command Prompt */
++#endif
++#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
++#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
++#define CFG_MAXARGS 16 /* max number of command args */
++#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
++#define CFG_DEVICE_NULLDEV 1
++
++#define CFG_MEMTEST_START 0xa0400000 /* memtest works on */
++#define CFG_MEMTEST_END 0xa0800000 /* 4 ... 8 MB in DRAM */
++
++#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
++
++#define CFG_LOAD_ADDR 0xa0030000 /* default load address */
++
++#define CFG_HZ 3686400 /* incrementer freq: 3.6864 MHz */
++#define CFG_CPUSPEED 0x161 /* set core clock to 400/200/100 MHz */
++
++ /* valid baudrates */
++#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
++#define CFG_MMC_BASE 0xF0000000
++
++/*
++ * Stack sizes
++ *
++ * The stack sizes are set up in start.S using the settings below
++ */
++#define CONFIG_STACKSIZE (128*1024) /* regular stack */
++#ifdef CONFIG_USE_IRQ
++#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
++#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
++#endif
++
++/*
++ * Physical Memory Map
++ */
++#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
++#define PHYS_SDRAM_1 0xa0000000 /* SDRAM Bank #1 */
++#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
++
++#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
++#define PHYS_FLASH_2 0x04000000 /* Flash Bank #2 */
++#define PHYS_FLASH_SIZE 0x02000000 /* 32 MB */
++#define PHYS_FLASH_BANK_SIZE 0x02000000 /* 32 MB Banks */
++#define PHYS_FLASH_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */
++
++#define CFG_DRAM_BASE 0xa0000000
++#define CFG_DRAM_SIZE 0x04000000
++
++
++/*
++ * Memory settings
++ */
++#define CFG_MSC0_VAL 0x23F223F2
++#define CFG_MSC1_VAL 0x3FF1A441
++#define CFG_MSC2_VAL 0x7FF97FF1
++#define CFG_MDCNFG_VAL 0x00001AC9
++#define CFG_MDREFR_VAL 0x00018018
++#define CFG_MDMRS_VAL 0x00000000
++
++/*
++ * FLASH and environment organization
++ */
++#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
++#define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
++
++/* timeout values are in ticks */
++#define CFG_FLASH_ERASE_TOUT (25*CFG_HZ) /* Timeout for Flash Erase */
++#define CFG_FLASH_WRITE_TOUT (25*CFG_HZ) /* Timeout for Flash Write */
++
++/*
++ * Environment is saved in flash at offset 1MB
++ */
++#define CFG_ENV_IS_IN_FLASH 1
++#define CFG_FLASH_BASE 0
++#define CFG_ENV_ADDR ((CFG_FLASH_BASE)+0x100000) /* Addr of Environment Sector */
++#define CFG_ENV_OFFSET ((CFG_ENV_ADDR)-(CFG_FLASH_BASE))
++#define CFG_ENV_SIZE PHYS_FLASH_SECT_SIZE /* Total Size of Environment Sector */
++
++/*
++ * GPIO settings
++ */
++#define CFG_GPSR0_VAL 0x00008000
++#define CFG_GPSR1_VAL 0x00FC0382
++#define CFG_GPSR2_VAL 0x0001FFFF
++#define CFG_GPCR0_VAL 0x00000000
++#define CFG_GPCR1_VAL 0x00000000
++#define CFG_GPCR2_VAL 0x00000000
++#define CFG_GPDR0_VAL 0x0060A800
++#define CFG_GPDR1_VAL 0x00FF0382
++#define CFG_GPDR2_VAL 0x0001C000
++#define CFG_GAFR0_L_VAL 0x98400000
++#define CFG_GAFR0_U_VAL 0x00002950
++#define CFG_GAFR1_L_VAL 0x000A9558
++#define CFG_GAFR1_U_VAL 0x0005AAAA
++#define CFG_GAFR2_L_VAL 0xA0000000
++#define CFG_GAFR2_U_VAL 0x00000002
++
++#define CFG_PSSR_VAL 0x20
++
++/*
++ * PCMCIA and CF Interfaces
++ */
++#define CFG_MECR_VAL 0x00000000
++#define CFG_MCMEM0_VAL 0x00010504
++#define CFG_MCMEM1_VAL 0x00010504
++#define CFG_MCATT0_VAL 0x00010504
++#define CFG_MCATT1_VAL 0x00010504
++#define CFG_MCIO0_VAL 0x00004715
++#define CFG_MCIO1_VAL 0x00004715
++
++#ifndef __ASSEMBLY__
++
++extern unsigned long const fbStart ;
++extern unsigned long paletteRegs ;
++
++#endif /* _ASMLANGUAGE */
++
++#endif
++
+diff -u -r --new-file u-boot-1.1.2/include/configs/neon.h u-boot-1.1.2-neon/include/configs/neon.h
+--- u-boot-1.1.2/include/configs/neon.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/configs/neon.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,395 @@
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/*
++ * neon.h
++ *
++ * This header file declares the configuration constants for the Boundary
++ * Devices Neon board.
++ *
++ * Change History :
++ *
++ * $Log: neon.h,v $
++ * Revision 1.27 2006/05/30 15:52:17 ericn
++ * -clear screen after SD wait loop
++ *
++ * Revision 1.26 2006/05/27 22:11:50 ericn
++ * -include 'not', 'sleep' commands, wait for SD, <esc><esc><esc> for prompt
++ *
++ * Revision 1.25 2005/10/22 02:09:31 ericn
++ * -add CONFIG_SUPPORT_VFAT
++ *
++ * Revision 1.24 2005/07/23 19:35:42 ericn
++ * -fix name
++ *
++ * Revision 1.23 2005/07/23 17:13:25 ericn
++ * -add USB support
++ *
++ * Revision 1.22 2005/07/18 01:48:15 tkisky
++ * -define display types
++ *
++ * Revision 1.21 2005/07/17 22:52:10 ericn
++ * -fix comment
++ *
++ * Revision 1.20 2005/07/17 22:36:37 ericn
++ * -merge w/boundaryLib
++ *
++ * Revision 1.19 2005/07/02 18:46:16 ericn
++ * -Neon always has CONFIG_SM501
++ *
++ * Revision 1.18 2005/07/02 14:57:11 ericn
++ * -include INITRD tag
++ *
++ * Revision 1.17 2005/06/02 04:55:06 ericn
++ * -auto-choose qvga_portrait for DA240X320
++ *
++ * Revision 1.16 2005/06/02 04:10:30 ericn
++ * -save environment in flash
++ *
++ * Revision 1.15 2005/05/08 22:07:31 ericn
++ * -added 1024x768, 800x480 options
++ *
++ * Revision 1.14 2005/05/05 04:11:53 ericn
++ * -add flash commands, sharp_vga display selector
++ *
++ * Revision 1.13 2005/05/05 03:22:20 ericn
++ * -change default load addr to WinCE's
++ *
++ * Revision 1.12 2005/05/04 04:22:23 ericn
++ * -updated to allow DHCP
++ *
++ * Revision 1.11 2005/05/03 15:28:56 ericn
++ * -include DHCP support
++ *
++ * Revision 1.10 2005/05/02 15:14:26 ericn
++ * -add SMC driver, remove hard-coded MAC
++ *
++ * Revision 1.9 2005/05/01 15:21:41 ericn
++ * -change crtPalette -> paletteRegs
++ *
++ * Revision 1.8 2005/04/28 03:41:23 ericn
++ * -pass RAM qty to Linux
++ *
++ * Revision 1.7 2005/04/28 03:35:32 ericn
++ * -default to cramfs
++ *
++ * Revision 1.6 2005/04/22 01:57:39 ericn
++ * -fix default boot args
++ *
++ * Revision 1.5 2005/04/20 09:05:36 tkisky
++ * -include select.h
++ *
++ * Revision 1.4 2005/04/18 13:49:10 ericn
++ * -default wvga, use init.scr
++ *
++ * Revision 1.3 2005/04/18 03:58:48 ericn
++ * -added autoscr, hush parser support
++ *
++ * Revision 1.2 2005/04/15 10:41:35 tkisky
++ * -remove LCD_XRES,LCD_YRES, remove extra mmcinit
++ *
++ * Revision 1.1 2005/04/09 17:49:25 ericn
++ * -Initial import
++ *
++ *
++ * 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
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++/*
++ * If we are developing, we might want to start armboot from ram
++ * so we MUST NOT initialize critical regs like mem-timing ...
++ */
++#include "select.h"
++
++#define CONFIG_INIT_CRITICAL /* undef for developing */
++#define CONFIG_SETUP_MEMORY_TAGS 1
++#define CONFIG_INITRD_TAG 1
++
++/*
++ * High Level Configuration Options
++ * (easy to change)
++ */
++#define CONFIG_PXA250 1 /* This is an PXA250 CPU */
++#define CONFIG_NEON 1 /* on a Neon Board */
++#define CONFIG_SM501 1
++#define CONFIG_LCD 1
++
++#define CONFIG_MMC 1
++#define BOARD_LATE_INIT 1
++
++#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
++
++/*
++ * Size of malloc() pool
++ */
++#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
++#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
++#define CFG_MMU_SPACE_RESERVED (1<<14)
++
++/*
++ * Hardware drivers
++ */
++#define CONFIG_DRIVER_SMC91111
++#define CONFIG_SMC91111_BASE 0x10000300
++#define CONFIG_SMC_USE_32_BIT
++
++/************************************************************
++ * USB support
++ ************************************************************/
++#define LITTLEENDIAN 1 /* Needed by usb_ohci.c */
++#define CFG_DEVICE_DEREGISTER 1 /* Needed by usb_kbd */
++#define CONFIG_DOS_PARTITION 1
++#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_KEYBOARD 1
++#define CONFIG_USB_STORAGE 1
++
++/*
++ * select serial console configuration
++ */
++#define CONFIG_FFUART 1 /* we use FFUART on NEON */
++
++/* allow to overwrite serial and ethaddr */
++//#define CONFIG_ENV_OVERWRITE
++
++#define CONFIG_BAUDRATE 115200
++
++#define SKIP_COMMANDS ( CFG_CMD_BDI \
++ | CFG_CMD_BOOTD \
++ | CFG_CMD_LOADS \
++ | CFG_CMD_LOADB \
++ | CFG_CMD_ITEST \
++ | CFG_CMD_FPGA \
++ | CFG_CMD_ECHO \
++ | CFG_CMD_DIAG \
++ | CFG_CMD_DATE \
++ | CFG_CMD_BOOTP \
++ | CFG_CMD_NFS \
++ )
++// | CFG_CMD_FLASH
++// | CFG_CMD_DHCP
++// | CFG_CMD_NET
++// | CFG_CMD_MEMORY
++// | CFG_CMD_ENV
++
++#define CONFIG_SUPPORT_VFAT
++#define CONFIG_COMMANDS ( (CONFIG_CMD_DFL \
++ | CFG_CMD_MMC \
++ | CFG_CMD_FAT \
++ | CFG_CMD_LCDPANEL \
++ | CFG_CMD_FLASH \
++ | CFG_CMD_DHCP \
++ | CFG_CMD_ENV \
++ | CFG_CMD_USB \
++ | CFG_CMD_NOT \
++ | CFG_CMD_MISC \
++ | CFG_CMD_BMP) & ~(SKIP_COMMANDS) )
++
++/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
++#include <cmd_confdefs.h>
++#define CONFIG_BOOTDELAY 3
++#define CONFIG_BOOTCOMMAND "while not mmcdet ; do cls ; lecho \"insert SD card\" ; sleep 1 ; done ; cls" \
++ "if mmcwp ; then lecho \"write protected\" ; else lecho \"not write protected\" ; fi ; " \
++ "mmcinit; " \
++ "if fatload mmc 0 a0000000 init.scr ; then autoscr a0000000 ; fi"
++#define CONFIG_BOOTARGS "console=ttyS0,115200 DEBUG=1 ENV=/etc/bashrc init=/linuxrc rw mtdparts=phys:1024k(armboot),256k(params),-(rootfs1) root=/dev/mtdblock3 rootfstype=cramfs"
++#define CONFIG_CMDLINE_TAG
++
++#define CONFIG_GZIP
++
++#define CONFIG_AUTOBOOT_KEYED /* Enable password protection */
++#define CONFIG_AUTOBOOT_PROMPT "\nEnter password - autoboot in %d sec...\n"
++#define CONFIG_AUTOBOOT_DELAY_STR "\x1b\x1b\x1b"
++
++/*
++ * Choose one of the following:
++ *
++ * hitachi_qvga
++ * sharp_qvga
++ * hitachi_hvga
++ * sharp_vga
++ * hitachi_wvga - 7 or 9 inch
++ */
++#ifndef DA320X240
++#define DA320X240 0
++#define DA640X240 1
++#define DA800X480 2
++#define DA640X480 3
++#define DA240X320 4
++#define DA800X600 5
++#define DA1024X768 6
++#define DP480X320 7
++#define DP320X240 8
++#define DL122X32 9
++#endif
++
++#if DISPLAY_TYPE == DA640X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_hvga" "\0"
++#elif DISPLAY_TYPE == DA240X320
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=qvga_portrait" "\0"
++#elif DISPLAY_TYPE == DA320X240
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_qvga" "\0"
++#elif DISPLAY_TYPE == DA8000X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA640X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=sharp_vga" "\0"
++#elif DISPLAY_TYPE == DA800X480
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=hitachi_wvga" "\0"
++#elif DISPLAY_TYPE == DA1024X768
++#define CONFIG_EXTRA_ENV_SETTINGS "panel=crt1024x768" "\0"
++#else
++#error No display selected
++#endif
++
++#define LCD_BPP LCD_COLOR8
++
++
++#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */
++#define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */
++#endif
++
++/*
++ * Miscellaneous configurable options
++ */
++#define CFG_HUSH_PARSER 1
++#define CFG_PROMPT_HUSH_PS2 "> "
++
++#define CFG_LONGHELP /* undef to save memory */
++#ifdef CFG_HUSH_PARSER
++#define CFG_PROMPT "$ " /* Monitor Command Prompt */
++#else
++#define CFG_PROMPT "=> " /* Monitor Command Prompt */
++#endif
++#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
++#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
++#define CFG_MAXARGS 16 /* max number of command args */
++#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
++#define CFG_DEVICE_NULLDEV 1
++
++#define CFG_MEMTEST_START 0xa0400000 /* memtest works on */
++#define CFG_MEMTEST_END 0xa0800000 /* 4 ... 8 MB in DRAM */
++
++#undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
++
++#define CFG_LOAD_ADDR 0xa0030000 /* default load address */
++
++#define CFG_HZ 3686400 /* incrementer freq: 3.6864 MHz */
++#define CFG_CPUSPEED 0x161 /* set core clock to 400/200/100 MHz */
++
++ /* valid baudrates */
++#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
++#define CFG_MMC_BASE 0xF0000000
++
++/*
++ * Stack sizes
++ *
++ * The stack sizes are set up in start.S using the settings below
++ */
++#define CONFIG_STACKSIZE (128*1024) /* regular stack */
++#ifdef CONFIG_USE_IRQ
++#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
++#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
++#endif
++
++/*
++ * Physical Memory Map
++ */
++#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
++#define PHYS_SDRAM_1 0xa0000000 /* SDRAM Bank #1 */
++#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
++
++#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
++#define PHYS_FLASH_2 0x04000000 /* Flash Bank #2 */
++#define PHYS_FLASH_SIZE 0x02000000 /* 32 MB */
++#define PHYS_FLASH_BANK_SIZE 0x02000000 /* 32 MB Banks */
++#define PHYS_FLASH_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */
++
++#define CFG_DRAM_BASE 0xa0000000
++#define CFG_DRAM_SIZE 0x04000000
++
++
++/*
++ * Memory settings
++ */
++#define CFG_MSC0_VAL 0x23F223F2
++#define CFG_MSC1_VAL 0x3FF1A441
++#define CFG_MSC2_VAL 0x7FF97FF1
++#define CFG_MDCNFG_VAL 0x00001AC9
++#define CFG_MDREFR_VAL 0x00018018
++#define CFG_MDMRS_VAL 0x00000000
++
++/*
++ * FLASH and environment organization
++ */
++#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
++#define CFG_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
++
++/* timeout values are in ticks */
++#define CFG_FLASH_ERASE_TOUT (25*CFG_HZ) /* Timeout for Flash Erase */
++#define CFG_FLASH_WRITE_TOUT (25*CFG_HZ) /* Timeout for Flash Write */
++
++/*
++ * Environment is saved in flash at offset 1MB
++ */
++#define CFG_ENV_IS_IN_FLASH 1
++#define CFG_FLASH_BASE 0
++#define CFG_ENV_ADDR ((CFG_FLASH_BASE)+0x100000) /* Addr of Environment Sector */
++#define CFG_ENV_OFFSET ((CFG_ENV_ADDR)-(CFG_FLASH_BASE))
++#define CFG_ENV_SIZE PHYS_FLASH_SECT_SIZE /* Total Size of Environment Sector */
++
++/*
++ * GPIO settings
++ */
++#define CFG_GPSR0_VAL 0x00008000
++#define CFG_GPSR1_VAL 0x00FC0382
++#define CFG_GPSR2_VAL 0x0001FFFF
++#define CFG_GPCR0_VAL 0x00000000
++#define CFG_GPCR1_VAL 0x00000000
++#define CFG_GPCR2_VAL 0x00000000
++#define CFG_GPDR0_VAL 0x0060A800
++#define CFG_GPDR1_VAL 0x00FF0382
++#define CFG_GPDR2_VAL 0x0001C000
++#define CFG_GAFR0_L_VAL 0x98400000
++#define CFG_GAFR0_U_VAL 0x00002950
++#define CFG_GAFR1_L_VAL 0x000A9558
++#define CFG_GAFR1_U_VAL 0x0005AAAA
++#define CFG_GAFR2_L_VAL 0xA0000000
++#define CFG_GAFR2_U_VAL 0x00000002
++
++#define CFG_PSSR_VAL 0x20
++
++/*
++ * PCMCIA and CF Interfaces
++ */
++#define CFG_MECR_VAL 0x00000000
++#define CFG_MCMEM0_VAL 0x00010504
++#define CFG_MCMEM1_VAL 0x00010504
++#define CFG_MCATT0_VAL 0x00010504
++#define CFG_MCATT1_VAL 0x00010504
++#define CFG_MCIO0_VAL 0x00004715
++#define CFG_MCIO1_VAL 0x00004715
++
++#ifndef __ASSEMBLY__
++
++extern unsigned long const fbStart ;
++extern unsigned long paletteRegs ;
++
++#endif /* _ASMLANGUAGE */
++
++#endif
++
+diff -u -r --new-file u-boot-1.1.2/include/fat.h u-boot-1.1.2-neon/include/fat.h
+--- u-boot-1.1.2/include/fat.h 2004-04-23 22:32:07.000000000 +0200
++++ u-boot-1.1.2-neon/include/fat.h 2007-08-11 21:07:21.000000000 +0200
+@@ -177,13 +177,13 @@
+
+ /* Private filesystem parameters */
+ typedef struct {
++ __u8 fatbuf[FATBUFSIZE]; /* Current FAT buffer */
+ int fatsize; /* Size of FAT in bits */
+ __u16 fatlength; /* Length of FAT in sectors */
+ __u16 fat_sect; /* Starting sector of the FAT */
+ __u16 rootdir_sect; /* Start sector of root directory */
+ __u16 clust_size; /* Size of clusters in sectors */
+ short data_begin; /* The sector of the first cluster, can be negative */
+- __u8 fatbuf[FATBUFSIZE]; /* Current FAT buffer */
+ int fatbufnum; /* Used by get_fatent, init to -1 */
+ } fsdata;
+
+diff -u -r --new-file u-boot-1.1.2/include/lcd.h u-boot-1.1.2-neon/include/lcd.h
+--- u-boot-1.1.2/include/lcd.h 2004-10-10 01:26:01.000000000 +0200
++++ u-boot-1.1.2-neon/include/lcd.h 2007-08-11 21:07:21.000000000 +0200
+@@ -31,7 +31,6 @@
+
+ extern char lcd_is_enabled;
+
+-extern int lcd_line_length;
+ extern int lcd_color_fg;
+ extern int lcd_color_bg;
+
+@@ -53,6 +52,7 @@
+ ushort vl_row; /* Number of rows (i.e. 480) */
+ ushort vl_width; /* Width of display area in millimeters */
+ ushort vl_height; /* Height of display area in millimeters */
++ int vl_lcd_line_length;
+
+ /* LCD configuration register */
+ u_char vl_clkp; /* Clock polarity */
+@@ -77,7 +77,7 @@
+
+ extern vidinfo_t panel_info;
+
+-#elif defined CONFIG_PXA250
++#elif defined( PXALCD )
+ /*
+ * PXA LCD DMA descriptor
+ */
+@@ -119,6 +119,7 @@
+ ushort vl_row; /* Number of rows (i.e. 480) */
+ ushort vl_width; /* Width of display area in millimeters */
+ ushort vl_height; /* Height of display area in millimeters */
++ int vl_lcd_line_length;
+
+ /* LCD configuration register */
+ u_char vl_clkp; /* Clock polarity */
+@@ -148,7 +149,29 @@
+
+ extern vidinfo_t panel_info;
+
+-#endif /* CONFIG_MPC823 or CONFIG_PXA250 */
++#if defined( CONFIG_PXA250 )
++ #define PALETTEVAL_TYPE u16
++#elif defined( CONFIG_PXA270 )
++ #define PALETTEVAL_TYPE u32
++#else
++#error no processor defined
++#endif
++
++#elif defined( CONFIG_SM501 )
++
++/*
++ * LCD controller stucture for PXA CPU
++ */
++typedef struct vidinfo {
++ ushort vl_col; /* Number of columns (i.e. 640) */
++ ushort vl_row; /* Number of rows (i.e. 480) */
++ int vl_lcd_line_length;
++ u_char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
++} vidinfo_t;
++
++extern vidinfo_t panel_info;
++
++#endif /* CONFIG_MPC823 */
+
+ /* Video functions */
+
+@@ -272,7 +295,7 @@
+ #endif
+
+ #define CONSOLE_COLS (panel_info.vl_col / VIDEO_FONT_WIDTH)
+-#define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * lcd_line_length)
++#define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * panel_info.vl_lcd_line_length)
+ #define CONSOLE_ROW_FIRST (lcd_console_address)
+ #define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
+ #define CONSOLE_ROW_LAST (lcd_console_address + CONSOLE_SIZE \
+diff -u -r --new-file u-boot-1.1.2/include/lcd_panels.h u-boot-1.1.2-neon/include/lcd_panels.h
+--- u-boot-1.1.2/include/lcd_panels.h 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/include/lcd_panels.h 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,83 @@
++#ifndef __LCD_PANELS_H__
++#define __LCD_PANELS_H__ "$Id: lcd_panels.h,v 1.3 2005/06/02 04:03:37 ericn Exp $"
++
++/*
++ * lcd_panels.h
++ *
++ * This header file declares the lcd_panel_info_t
++ * data type and the num_lcd_panels and lcd_panels
++ * constants for use in initializing a variety of displays.
++ *
++ * Note that this is based on the pxafb_mach_info structure
++ * in linux-2.4.19/drivers/video/pxafb.h (Nico's patches),
++ * but differs in a couple of respects:
++ *
++ * Doesn't support the color-mapping stuff
++ * Includes an 'active' flag
++ *
++ * Doesn't include the lccr0 and lccr3 fields, since most of
++ * the fields in those registers are display controller options,
++ * not panel options, and the others (so far) can have reasonable
++ * defaults. When (if) we need to support a non-standard display,
++ * we can fill in the blanks with defaults in the previously
++ * supported displays and compute lccr0 and lccr3.
++ *
++ * Change History :
++ *
++ * $Log: lcd_panels.h,v $
++ * Revision 1.3 2005/06/02 04:03:37 ericn
++ * -added rotation field
++ *
++ * Revision 1.2 2005/04/30 20:33:36 ericn
++ * -added CRT support
++ *
++ * Revision 1.1 2005/04/09 17:49:18 ericn
++ * -Initial import
++ *
++ *
++ * Copyright Boundary Devices, Inc. 2005
++ */
++
++struct lcd_panel_info_t {
++ char const *name ;
++ unsigned long pixclock;
++
++ unsigned short xres;
++ unsigned short yres;
++
++ unsigned act_high ; // clock is active high
++ unsigned hsync_len;
++ unsigned left_margin;
++ unsigned right_margin;
++ unsigned vsync_len;
++ unsigned upper_margin;
++ unsigned lower_margin;
++ unsigned active ; // active matrix (TFT) LCD
++ unsigned crt ; // 1 == CRT, not LCD
++ unsigned rotation ;
++};
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++extern unsigned const num_lcd_panels ;
++extern struct lcd_panel_info_t const * const lcd_panels ;
++
++extern struct lcd_panel_info_t const *find_lcd_panel( char const * name );
++
++
++//
++// Each platform needs to define this routine, and
++// set cur_lcd_panel within
++//
++void set_lcd_panel( struct lcd_panel_info_t const *panel );
++extern struct lcd_panel_info_t const *cur_lcd_panel ;
++void disable_lcd_panel( void );
++
++#ifdef __CPLUSPLUS
++};
++#endif
++
++#endif
++
+diff -u -r --new-file u-boot-1.1.2/include/part.h u-boot-1.1.2-neon/include/part.h
+--- u-boot-1.1.2/include/part.h 2004-04-18 19:39:40.000000000 +0200
++++ u-boot-1.1.2-neon/include/part.h 2007-08-11 21:07:21.000000000 +0200
+@@ -24,6 +24,48 @@
+ #define _PART_H
+ #include <ide.h>
+
++enum {
++/* These three have identical behaviour; use the second one if DOS fdisk gets
++ confused about extended/logical partitions starting past cylinder 1023. */
++ DOS_EXTENDED_PARTITION = 5,
++ LINUX_EXTENDED_PARTITION = 0x85,
++ WIN98_EXTENDED_PARTITION = 0x0f,
++
++ LINUX_SWAP_PARTITION = 0x82,
++ LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */
++
++ SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
++
++ DM6_PARTITION = 0x54, /* has DDO: use xlated geom & offset */
++ EZD_PARTITION = 0x55, /* EZ-DRIVE */
++ DM6_AUX1PARTITION = 0x51, /* no DDO: use xlated geom */
++ DM6_AUX3PARTITION = 0x53, /* no DDO: use xlated geom */
++
++ FREEBSD_PARTITION = 0xa5, /* FreeBSD Partition ID */
++ OPENBSD_PARTITION = 0xa6, /* OpenBSD Partition ID */
++ NETBSD_PARTITION = 0xa9, /* NetBSD Partition ID */
++ BSDI_PARTITION = 0xb7, /* BSDI Partition ID */
++/* Ours is not to wonder why.. */
++ BSD_PARTITION = FREEBSD_PARTITION,
++ MINIX_PARTITION = 0x81, /* Minix Partition ID */
++ PLAN9_PARTITION = 0x39, /* Plan 9 Partition ID */
++ UNIXWARE_PARTITION = 0x63, /* Partition ID, same as */
++ /* GNU_HURD and SCO Unix */
++};
++
++struct partition {
++ unsigned char boot_ind; /* 0x80 - active */
++ unsigned char head; /* starting head */
++ unsigned char sector; /* starting sector */
++ unsigned char cyl; /* starting cylinder */
++ unsigned char sys_ind; /* What partition type */
++ unsigned char end_head; /* end head */
++ unsigned char end_sector; /* end sector */
++ unsigned char end_cyl; /* end cylinder */
++ unsigned int start_sect; /* starting sector counting from 0 */
++ unsigned int nr_sects; /* nr of sectors in partition */
++} __attribute__((packed));
++
+ typedef struct block_dev_desc {
+ int if_type; /* type of the interface */
+ int dev; /* device number */
+@@ -118,4 +160,15 @@
+ int test_part_amiga (block_dev_desc_t *dev_desc);
+ #endif
+
++/* Value returned by `fnmatch' if STRING does not match PATTERN. */
++#define FNM_NOMATCH 1
++
++/* Bits set in the FLAGS argument to `fnmatch'. */
++#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
++#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
++#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
++#define FNM_NOSYS (-1)
++
++int fnmatch(const char *pattern, const char *string, int flags);
++
+ #endif /* _PART_H */
+diff -u -r --new-file u-boot-1.1.2/lib_arm/armlinux.c u-boot-1.1.2-neon/lib_arm/armlinux.c
+--- u-boot-1.1.2/lib_arm/armlinux.c 2004-10-10 01:26:01.000000000 +0200
++++ u-boot-1.1.2-neon/lib_arm/armlinux.c 2007-08-11 21:07:21.000000000 +0200
+@@ -29,6 +29,7 @@
+ #ifdef CONFIG_HAS_DATAFLASH
+ #include <dataflash.h>
+ #endif
++#include "lcd_panels.h"
+
+ /*cmd_boot.c*/
+ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+@@ -88,6 +89,16 @@
+
+ #ifdef CONFIG_CMDLINE_TAG
+ char *commandline = getenv ("bootargs");
++ if( ( 0 != cur_lcd_panel ) && ( 0 != cur_lcd_panel->rotation ) )
++ {
++ char temp[80];
++ int addedLen = sprintf( temp, " fbrotation=%u", cur_lcd_panel->rotation );
++ unsigned cmdLen = strlen( commandline );
++ char *bigger = (char *)malloc( cmdLen + addedLen + 1 );
++ strcpy( bigger, commandline );
++ strcpy( bigger+cmdLen, temp );
++ commandline = bigger ;
++ }
+ #endif
+
+ theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
+@@ -365,6 +376,7 @@
+ * We only use it to pass the address and size, the other entries
+ * in the tag_videolfb are not of interest.
+ */
++#ifdef VESA_DISPLAY
+ params->hdr.tag = ATAG_VIDEOLFB;
+ params->hdr.size = tag_size (tag_videolfb);
+
+@@ -374,6 +386,7 @@
+ params->u.videolfb.lfb_size = calc_fbsize();
+
+ params = tag_next (params);
++#endif
+ }
+ #endif /* CONFIG_VFD || CONFIG_LCD */
+
+diff -u -r --new-file u-boot-1.1.2/lib_arm/board.c u-boot-1.1.2-neon/lib_arm/board.c
+--- u-boot-1.1.2/lib_arm/board.c 2004-08-02 00:48:22.000000000 +0200
++++ u-boot-1.1.2-neon/lib_arm/board.c 2007-08-11 21:07:21.000000000 +0200
+@@ -216,7 +216,10 @@
+ #endif
+
+ /* Pointer is writable since we allocated a register for it */
+- gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));
++#ifndef CFG_MMU_SPACE_RESERVED
++#define CFG_MMU_SPACE_RESERVED 0
++#endif
++ gd = (gd_t*)(_armboot_start - CFG_MMU_SPACE_RESERVED - CFG_MALLOC_LEN - sizeof(gd_t));
+ /* compiler optimization barrier needed for GCC >= 3.4 */
+ __asm__ __volatile__("": : :"memory");
+
+@@ -263,7 +266,7 @@
+ #endif /* CONFIG_LCD */
+
+ /* armboot_start is defined in the board-specific linker script */
+- mem_malloc_init (_armboot_start - CFG_MALLOC_LEN);
++ mem_malloc_init (_armboot_start - CFG_MMU_SPACE_RESERVED - CFG_MALLOC_LEN);
+
+ #if (CONFIG_COMMANDS & CFG_CMD_NAND)
+ puts ("NAND:");
+diff -u -r --new-file u-boot-1.1.2/make_all u-boot-1.1.2-neon/make_all
+--- u-boot-1.1.2/make_all 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/make_all 2007-08-11 21:07:21.000000000 +0200
+@@ -0,0 +1,31 @@
++#!/bin/sh
++halogen1_clock="416"
++halogen2_clock="416"
++bd2003_clock="400"
++neon_clock="400"
++neonb_clock="400"
++
++SOFTWARE="LINUX"
++
++targets="halogen1 halogen2 bd2003 neon neonb"
++for suff in $targets ; do
++ make distclean ;
++ REV=""
++ PLATFORM="$suff"
++ if [ $suff = "halogen1" ] ; then REV="1\n"; PLATFORM="halogen"
++ else
++ if [ $suff = "halogen2" ] ; then REV="2\n"; PLATFORM="halogen"
++ fi
++ fi
++ eval clock=\$$suff"_clock"
++ echo -e "DA640X240\n$REV$SOFTWARE\ny\n$clock\n" | make $PLATFORM"_config" ;
++ make u-boot.bin ;
++ mv u-boot.bin u-boot-$suff
++done
++
++
++for suff in $targets ; do
++ mv u-boot-$suff u-boot-$suff.bin
++done
++
++zip u-boot-binaries.zip u-boot-*.bin
+diff -u -r --new-file u-boot-1.1.2/Makefile u-boot-1.1.2-neon/Makefile
+--- u-boot-1.1.2/Makefile 2004-12-19 10:58:11.000000000 +0100
++++ u-boot-1.1.2-neon/Makefile 2007-08-11 21:17:14.000000000 +0200
+@@ -57,7 +57,7 @@
+ CROSS_COMPILE = ppc_8xx-
+ endif
+ ifeq ($(ARCH),arm)
+-CROSS_COMPILE = arm-linux-
++CROSS_COMPILE = arm-elf-
+ endif
+ ifeq ($(ARCH),i386)
+ ifeq ($(HOSTARCH),i386)
+@@ -89,6 +89,9 @@
+ #########################################################################
+ # U-Boot objects....order is important (i.e. start must be first)
+
++ifeq ($(CPU),pxa)
++OBJS =
++else
+ OBJS = cpu/$(CPU)/start.o
+ ifeq ($(CPU),i386)
+ OBJS += cpu/$(CPU)/start16.o
+@@ -100,6 +103,7 @@
+ ifeq ($(CPU),mpc85xx)
+ OBJS += cpu/$(CPU)/resetvec.o
+ endif
++endif
+
+ LIBS = lib_generic/libgeneric.a
+ LIBS += board/$(BOARDDIR)/lib$(BOARD).a
+@@ -121,7 +125,8 @@
+ .PHONY : $(LIBS)
+
+ # Add GCC lib
+-PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
++LIBGCC_DIRNAME := $(shell dirname "`$(CC) $(CFLAGS) -print-libgcc-file-name`")
++PLATFORM_LIBS += --no-warn-mismatch -L "$(LIBGCC_DIRNAME)" -lgcc
+
+
+ # The "tools" are needed early, so put this first
+@@ -129,13 +134,14 @@
+ SUBDIRS = tools \
+ examples \
+ post \
+- post/cpu
++ post/cpu \
++ cpu/$(CPU)
+ .PHONY : $(SUBDIRS)
+
+ #########################################################################
+ #########################################################################
+
+-ALL = u-boot.srec u-boot.bin System.map
++ALL = u-boot.srec u-boot.bin System.map init.scr upgrade.scr
+
+ all: $(ALL)
+
+@@ -192,6 +198,12 @@
+ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
+ sort > System.map
+
++init.scr: board/$(BOARDDIR)/init.script
++ tools/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "autoscript" -d $< $@
++
++upgrade.scr: upgrade.script
++ tools/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-Boot upgrade script" -d $< $@
++
+ #########################################################################
+ else
+ all install u-boot u-boot.srec depend dep:
+@@ -203,6 +215,7 @@
+
+ unconfig:
+ @rm -f include/config.h include/config.mk board/*/config.tmp
++ @rm -f select.mk include/configs/select.h
+
+ #========================================================================
+ # PowerPC
+@@ -1388,6 +1401,22 @@
+ wepep250_config : unconfig
+ @./mkconfig $(@:_config=) arm pxa wepep250
+
++bd-neon_config : unconfig
++ @./mkconfig $(@:_config=) arm pxa neon
++ ./Configure --PLATFORM_TYPE=NEON
++
++neonb_config : unconfig
++ @./mkconfig neon arm pxa neon
++ ./Configure --PLATFORM_TYPE=NEONB --SOFTWARE_TYPE=WINCE --DISPLAY_TYPE=DA640X240
++
++bd2003_config : unconfig
++ @./mkconfig $(@:_config=) arm pxa bd2003
++ ./Configure --PLATFORM_TYPE=BD2003
++
++halogen_config : unconfig
++ @./mkconfig $(@:_config=) arm pxa halogen
++ ./Configure --PLATFORM_TYPE=HALOGEN
++
+ xaeniax_config : unconfig
+ @./mkconfig $(@:_config=) arm pxa xaeniax
+
+@@ -1558,10 +1587,16 @@
+ #########################################################################
+ #########################################################################
+
++ifeq ($(HOSTOS),cygwin)
++FIND = /bin/find
++else
++FIND = find
++endif
++
+ clean:
+- find . -type f \
++ $(FIND) . -type f \
+ \( -name 'core' -o -name '*.bak' -o -name '*~' \
+- -o -name '*.o' -o -name '*.a' \) -print \
++ -o -name '*.o' -o -name '*.a' -o -name '*.lst' \) -print \
+ | xargs rm -f
+ rm -f examples/hello_world examples/timer \
+ examples/eepro100_eeprom examples/sched \
+@@ -1575,7 +1610,7 @@
+ rm -f board/trab/trab_fkt
+
+ clobber: clean
+- find . -type f \( -name .depend \
++ $(FIND) . -type f \( -name .depend \
+ -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
+ -print0 \
+ | xargs -0 rm -f
+@@ -1585,6 +1620,8 @@
+ rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
+ rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
+ rm -f include/asm/proc include/asm/arch include/asm
++ cd tools && rm -f *.exe
++ rm -f include/configs/select.h select.mk select.log
+
+ mrproper \
+ distclean: clobber unconfig
+diff -u -r --new-file u-boot-1.1.2/patches/arm_flags.patch u-boot-1.1.2-neon/patches/arm_flags.patch
+--- u-boot-1.1.2/patches/arm_flags.patch 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/patches/arm_flags.patch 2007-08-11 21:01:36.000000000 +0200
+@@ -0,0 +1,15 @@
++
++#
++# Patch managed by http://www.holgerschurig.de/patcher.html
++#
++
++--- u-boot-1.1.2/cpu/pxa/config.mk~armflags
+++++ u-boot-1.1.2/cpu/pxa/config.mk
++@@ -23,6 +23,6 @@
++ #
++
++ PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
++- -mshort-load-bytes -msoft-float
+++ -msoft-float
++
++ PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100
+diff -u -r --new-file u-boot-1.1.2/patches/series u-boot-1.1.2-neon/patches/series
+--- u-boot-1.1.2/patches/series 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/patches/series 2007-08-11 21:01:36.000000000 +0200
+@@ -0,0 +1,2 @@
++arm_flags.patch -p1
++u-boot-2006-06-03.patch.gz -p1
+Binary files u-boot-1.1.2/patches/u-boot-2006-06-03.patch.gz and u-boot-1.1.2-neon/patches/u-boot-2006-06-03.patch.gz differ
+diff -u -r --new-file u-boot-1.1.2/.pc/applied-patches u-boot-1.1.2-neon/.pc/applied-patches
+--- u-boot-1.1.2/.pc/applied-patches 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/.pc/applied-patches 2007-08-11 21:01:36.000000000 +0200
+@@ -0,0 +1 @@
++arm_flags.patch
+diff -u -r --new-file u-boot-1.1.2/.pc/arm_flags.patch/cpu/pxa/config.mk u-boot-1.1.2-neon/.pc/arm_flags.patch/cpu/pxa/config.mk
+--- u-boot-1.1.2/.pc/arm_flags.patch/cpu/pxa/config.mk 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/.pc/arm_flags.patch/cpu/pxa/config.mk 2003-05-23 14:36:21.000000000 +0200
+@@ -0,0 +1,28 @@
++#
++# (C) Copyright 2002
++# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
++# Marius Groeger <mgroeger@sysgo.de>
++#
++# See file CREDITS for list of people who contributed to this
++# project.
++#
++# 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
++#
++
++PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
++ -mshort-load-bytes -msoft-float
++
++PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100
+diff -u -r --new-file u-boot-1.1.2/.pc/.version u-boot-1.1.2-neon/.pc/.version
+--- u-boot-1.1.2/.pc/.version 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/.pc/.version 2007-08-11 21:01:36.000000000 +0200
+@@ -0,0 +1 @@
++2
+diff -u -r --new-file u-boot-1.1.2/README u-boot-1.1.2-neon/README
+--- u-boot-1.1.2/README 2004-12-16 22:44:03.000000000 +0100
++++ u-boot-1.1.2-neon/README 2007-08-11 21:07:19.000000000 +0200
+@@ -608,6 +608,7 @@
+ CFG_CMD_ITEST Integer/string test of 2 values
+ CFG_CMD_JFFS2 * JFFS2 Support
+ CFG_CMD_KGDB * kgdb
++ CFG_CMD_LCDPANEL * Dynamic LCD Panel support
+ CFG_CMD_LOADB loadb
+ CFG_CMD_LOADS loads
+ CFG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base,
+@@ -812,6 +813,9 @@
+ for differential drivers: 0x00001000
+ for single ended drivers: 0x00005000
+
++- Dynamic LCD Panel support
++ Allows the choice of an LCD panel through the environment.
++ Also allows prompting for panel characteristics.
+
+ - MMC Support:
+ The MMC controller on the Intel PXA is supported. To
+diff -u -r --new-file u-boot-1.1.2/tools/mkimage.c u-boot-1.1.2-neon/tools/mkimage.c
+--- u-boot-1.1.2/tools/mkimage.c 2004-11-21 01:06:36.000000000 +0100
++++ u-boot-1.1.2-neon/tools/mkimage.c 2007-08-11 21:07:22.000000000 +0200
+@@ -618,10 +618,10 @@
+ printf ("Image Name: %.*s\n", IH_NMLEN, hdr->ih_name);
+ printf ("Created: %s", ctime(&timestamp));
+ printf ("Image Type: "); print_type(hdr);
+- printf ("Data Size: %d Bytes = %.2f kB = %.2f MB\n",
++ printf ("Data Size: %ld Bytes = %.2f kB = %.2f MB\n",
+ size, (double)size / 1.024e3, (double)size / 1.048576e6 );
+- printf ("Load Address: 0x%08X\n", ntohl(hdr->ih_load));
+- printf ("Entry Point: 0x%08X\n", ntohl(hdr->ih_ep));
++ printf ("Load Address: 0x%08lX\n", ntohl(hdr->ih_load));
++ printf ("Entry Point: 0x%08lX\n", ntohl(hdr->ih_ep));
+
+ if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
+ int i, ptrs;
+@@ -640,7 +640,7 @@
+ for (i=0; len_ptr[i]; ++i) {
+ size = ntohl(len_ptr[i]);
+
+- printf (" Image %d: %8d Bytes = %4d kB = %d MB\n",
++ printf (" Image %d: %8ld Bytes = %4ld kB = %ld MB\n",
+ i, size, size>>10, size>>20);
+ if (hdr->ih_type == IH_TYPE_SCRIPT && i > 0) {
+ /*
+@@ -648,7 +648,7 @@
+ * if planning to do something with
+ * multiple files
+ */
+- printf (" Offset = %08X\n", pos);
++ printf (" Offset = %08lX\n", pos);
+ }
+ /* copy_file() will pad the first files to even word align */
+ size += 3;
+diff -u -r --new-file u-boot-1.1.2/upgrade.script u-boot-1.1.2-neon/upgrade.script
+--- u-boot-1.1.2/upgrade.script 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-1.1.2-neon/upgrade.script 2007-08-11 21:07:22.000000000 +0200
+@@ -0,0 +1,32 @@
++lecho "---------> upgrade to newest U-Boot"
++echo "---------> upgrade to newest U-Boot"
++if fatload mmc 0 a0008000 u-boot-*.bin ; then
++ if cmp.b 0 a0008000 $filesize ; then
++ fatload mmc 0 a0008000 *.bmp
++ bmp display a0008000
++ lecho 'Already upgraded. Latest U-Boot is installed' ;
++ echo 'Already upgraded. Latest U-Boot is installed' ;
++ if mmcwp ; then
++ lecho "write protected" ;
++ else
++ lecho "not write protected" ;
++ fi
++ else
++ lecho 'Old U-Boot found. Upgrading' ;
++ echo 'Old U-Boot found. Upgrading' ;
++ protect off all ;
++ lecho 'Erasing' ;
++ echo 'Erasing' ;
++ erase 0 3FFFF ;
++ lecho 'Programming' ;
++ echo 'Programming' ;
++ cp.b a0008000 0 $filesize ;
++ lecho 'Done programming. Cycle power' ;
++ echo 'Done programming. Cycle power' ;
++ fi
++else
++ lecho 'Error loading new U-Boot from SD card'
++ echo 'Error loading new U-Boot from SD card'
++ lecho 'Should have u-boot-neon-something.bin'
++ echo 'Should have u-boot-neon-something.bin'
++fi
+\ No newline at end of file
diff --git a/packages/uboot/u-boot_1.1.2.bb b/packages/uboot/u-boot_1.1.2.bb
index 02fff45968..82b169ccc4 100644
--- a/packages/uboot/u-boot_1.1.2.bb
+++ b/packages/uboot/u-boot_1.1.2.bb
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "r2"
require u-boot.inc
SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
@@ -10,6 +10,7 @@ SRC_URI_append_mnci = "file://mnci.patch;patch=1 \
file://command-names.patch;patch=1"
SRC_URI_append_magicbox = "file://u-boot-emetec.patch;patch=1 "
+SRC_URI_append_bd-neon = "file://u-boot-1.1.2-neon.patch;patch=1"
# TODO: SRC_URI_append_rt3000
diff --git a/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-001-fix-mmap.patch b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-001-fix-mmap.patch
new file mode 100644
index 0000000000..4775e8c332
--- /dev/null
+++ b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-001-fix-mmap.patch
@@ -0,0 +1,91 @@
+--- uClibc-0.9.29.oorig/test/mmap/mmap2.c (revision 0)
++++ uClibc-0.9.29/test/mmap/mmap2.c (revision 18616)
+@@ -0,0 +1,41 @@
++/* When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap
++ * returns -EOVERFLOW.
++ *
++ * Since off_t is defined as a long int and the sign bit is set in the address,
++ * the shift operation shifts in ones instead of zeroes
++ * from the left. This results the offset sent to the kernel function becomes
++ * 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12.
++ */
++
++#include <unistd.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <sys/mman.h>
++
++#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
++ __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
++
++#define MAP_SIZE 4096UL
++#define MAP_MASK (MAP_SIZE - 1)
++
++int main(int argc, char **argv) {
++ void* map_base = 0;
++ int fd;
++ off_t target = 0xfffff000;
++ if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
++ printf("/dev/mem opened.\n");
++ fflush(stdout);
++
++ /* Map one page */
++ map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
++ fd, target & ~MAP_MASK);
++ if(map_base == (void *) -1) FATAL;
++ printf("Memory mapped at address %p.\n", map_base);
++ fflush(stdout);
++ if(munmap(map_base, MAP_SIZE) == -1) FATAL;
++ close(fd);
++ return 0;
++}
+--- uClibc-0.9.29.oorig/libc/sysdeps/linux/arm/mmap.c (revision 18615)
++++ uClibc-0.9.29/libc/sysdeps/linux/arm/mmap.c (revision 18616)
+@@ -27,7 +27,6 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
+
+ #elif defined (__NR_mmap2)
+ #define __NR__mmap __NR_mmap2
+-
+ #ifndef MMAP2_PAGE_SHIFT
+ # define MMAP2_PAGE_SHIFT 12
+ #endif
+@@ -39,9 +38,17 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
+ {
+ /* check if offset is page aligned */
+ if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
++ {
++ __set_errno(EINVAL);
+ return MAP_FAILED;
++ }
++#ifdef __USE_FILE_OFFSET64
++ return (__ptr_t) _mmap (addr, len, prot, flags,
++ fd,((__u_quad_t) offset >> MMAP2_PAGE_SHIFT));
++#else
+ return (__ptr_t) _mmap (addr, len, prot, flags,
+- fd,(off_t) (offset >> MMAP2_PAGE_SHIFT));
++ fd,((__u_long) offset >> MMAP2_PAGE_SHIFT));
++#endif
+ }
+ #elif defined (__NR_mmap)
+ # define __NR__mmap __NR_mmap
+--- uClibc-0.9.29.oorig/libc/sysdeps/linux/common/mmap64.c (revision 18615)
++++ uClibc-0.9.29/libc/sysdeps/linux/common/mmap64.c (revision 18616)
+@@ -58,8 +58,13 @@ __ptr_t mmap64(__ptr_t addr, size_t len,
+ __set_errno(EINVAL);
+ return MAP_FAILED;
+ }
+-
+- return __syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
++#ifdef __USE_FILE_OFFSET64
++ return __syscall_mmap2(addr, len, prot, flags,
++ fd,((__u_quad_t)offset >> MMAP2_PAGE_SHIFT));
++#else
++ return __syscall_mmap2(addr, len, prot, flags,
++ fd,((__u_long)offset >> MMAP2_PAGE_SHIFT));
++#endif
+ }
+
+ # endif
diff --git a/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-conditional-sched_affinity.patch b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-conditional-sched_affinity.patch
new file mode 100644
index 0000000000..509c42af52
--- /dev/null
+++ b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-conditional-sched_affinity.patch
@@ -0,0 +1,53 @@
+diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
+--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c 2007-02-12 16:52:32.000000000 -0600
++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c 2007-05-09 18:05:09.397411811 -0500
+@@ -29,6 +29,7 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+
++#ifdef __NR_sched_getaffinity
+ libc_hidden_proto(memset)
+
+ #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
+@@ -48,5 +49,15 @@
+ }
+ return res;
+ }
++#else
++/*
++int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
++{
++ __set_errno(ENOSYS);
++ return -1;
++}
++*/
+ #endif
+ #endif
++
++#endif
+diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
+--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c 2007-02-12 16:52:32.000000000 -0600
++++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c 2007-05-09 18:05:09.397411811 -0500
+@@ -31,6 +31,7 @@
+ #include <sys/types.h>
+ #include <alloca.h>
+
++#ifdef __NR_sched_setaffinity
+ libc_hidden_proto(getpid)
+
+ #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
+@@ -74,5 +75,14 @@
+
+ return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+ }
++#else
++/*
++int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
++{
++ __set_errno(ENOSYS);
++ return -1;
++}
++*/
++#endif
+ #endif
+ #endif
diff --git a/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-gethostent_r-failure-retval.patch b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-gethostent_r-failure-retval.patch
new file mode 100644
index 0000000000..7b246c1ad7
--- /dev/null
+++ b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-gethostent_r-failure-retval.patch
@@ -0,0 +1,12 @@
+diff -ur uClibc-0.9.29/libc/inet/resolv.c uClibc-0.9.29-patched/libc/inet/resolv.c
+--- uClibc-0.9.29/libc/inet/resolv.c 2007-04-23 12:01:05.000000000 -0500
++++ uClibc-0.9.29-patched/libc/inet/resolv.c 2007-05-09 18:05:33.563404419 -0500
+@@ -1700,7 +1700,7 @@
+ int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
+ struct hostent **result, int *h_errnop)
+ {
+- int ret;
++ int ret = HOST_NOT_FOUND;
+
+ __UCLIBC_MUTEX_LOCK(mylock);
+ if (__gethostent_fp == NULL) {
diff --git a/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-internal_function-definition.patch b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-internal_function-definition.patch
new file mode 100644
index 0000000000..9b88d826f1
--- /dev/null
+++ b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-fix-internal_function-definition.patch
@@ -0,0 +1,51 @@
+Index: uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
+===================================================================
+--- uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h (revision 18898)
++++ uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h (working copy)
+@@ -42,6 +42,8 @@
+ /* define if target supports IEEE signed zero floats */
+ #define __UCLIBC_HAVE_SIGNED_ZERO__
+
++#if defined _LIBC
+ #define internal_function __attribute__ ((regparm (3), stdcall))
++#endif
+
+ #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
+Index: uClibc/include/libc-symbols.h
+===================================================================
+--- uClibc/include/libc-symbols.h (revision 18898)
++++ uClibc/include/libc-symbols.h (working copy)
+@@ -22,6 +22,16 @@
+ #ifndef _LIBC_SYMBOLS_H
+ #define _LIBC_SYMBOLS_H 1
+
++/* This is defined for the compilation of all C library code. features.h
++ tests this to avoid inclusion of stubs.h while compiling the library,
++ before stubs.h has been generated. Some library code that is shared
++ with other packages also tests this symbol to see if it is being
++ compiled as part of the C library. We must define this before including
++ config.h, because it makes some definitions conditional on whether libc
++ itself is being compiled, or just some generator program. */
++#define _LIBC 1
++
++
+ /* This file's macros are included implicitly in the compilation of every
+ file in the C library by -imacros.
+
+@@ -40,16 +50,6 @@
+
+ #include <bits/uClibc_arch_features.h>
+
+-
+-/* This is defined for the compilation of all C library code. features.h
+- tests this to avoid inclusion of stubs.h while compiling the library,
+- before stubs.h has been generated. Some library code that is shared
+- with other packages also tests this symbol to see if it is being
+- compiled as part of the C library. We must define this before including
+- config.h, because it makes some definitions conditional on whether libc
+- itself is being compiled, or just some generator program. */
+-#define _LIBC 1
+-
+ /* Enable declarations of GNU extensions, since we are compiling them. */
+ #define _GNU_SOURCE 1
+
diff --git a/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-rm-whitespace.patch b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-rm-whitespace.patch
new file mode 100644
index 0000000000..6004f91e32
--- /dev/null
+++ b/packages/uclibc/uclibc-0.9.29/uClibc-0.9.29-rm-whitespace.patch
@@ -0,0 +1,86 @@
+diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
+--- uClibc-0.9.29-0rig/include/assert.h 2005-11-03 23:42:46.000000000 +0100
++++ uClibc-0.9.29/include/assert.h 2007-08-13 19:10:57.000000000 +0200
+@@ -31,7 +31,7 @@
+ #define _ASSERT_H 1
+ #include <features.h>
+
+-#if defined __cplusplus && __GNUC_PREREQ (2,95)
++#if defined __cplusplus && __GNUC_PREREQ(2,95)
+ # define __ASSERT_VOID_CAST static_cast<void>
+ #else
+ # define __ASSERT_VOID_CAST (void)
+@@ -59,13 +59,17 @@
+ (__ASSERT_VOID_CAST ((expr) ? 0 : \
+ (__assert (__STRING(expr), __FILE__, __LINE__, \
+ __ASSERT_FUNCTION), 0)))
+-
++
++/* Define some temporaries to workaround tinyx makedepend bug */
++#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
++#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
+ /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
+ which contains the name of the function currently being defined.
+ This is broken in G++ before version 2.6.
+ C9x has a similar variable called __func__, but prefer the GCC one since
+ it demangles C++ function names. */
+-# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
++
++# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
+ # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
+ # else
+ # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
+--- uClibc-0.9.29-0rig/include/complex.h 2002-05-09 10:15:21.000000000 +0200
++++ uClibc-0.9.29/include/complex.h 2007-08-13 17:55:29.000000000 +0200
+@@ -33,7 +33,7 @@
+ /* We might need to add support for more compilers here. But since ISO
+ C99 is out hopefully all maintained compilers will soon provide the data
+ types `float complex' and `double complex'. */
+-#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
++#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
+ # define _Complex __complex__
+ #endif
+
+diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
+--- uClibc-0.9.29-0rig/include/features.h 2006-11-29 22:10:04.000000000 +0100
++++ uClibc-0.9.29/include/features.h 2007-08-13 17:55:51.000000000 +0200
+@@ -143,7 +143,7 @@
+
+ /* Convenience macros to test the versions of glibc and gcc.
+ Use them like this:
+- #if __GNUC_PREREQ (2,8)
++ #if __GNUC_PREREQ(2,8)
+ ... code requiring gcc 2.8 or later ...
+ #endif
+ Note - they won't work for gcc1 or glibc1, since the _MINOR macros
+@@ -297,7 +297,7 @@
+ /* uClibc does not support _FORTIFY_SOURCE */
+ #undef _FORTIFY_SOURCE
+ #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
+- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
++ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+ # if _FORTIFY_SOURCE > 1
+ # define __USE_FORTIFY_LEVEL 2
+ # else
+@@ -366,7 +366,7 @@
+ #endif /* !ASSEMBLER */
+
+ /* Decide whether we can define 'extern inline' functions in headers. */
+-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
++#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
+ # define __USE_EXTERN_INLINES 1
+ #endif
+diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
+--- uClibc-0.9.29-0rig/include/tgmath.h 2002-05-09 10:15:21.000000000 +0200
++++ uClibc-0.9.29/include/tgmath.h 2007-08-13 17:56:17.000000000 +0200
+@@ -34,7 +34,7 @@
+ do not try this for now and instead concentrate only on GNU CC. Once
+ we have more information support for other compilers might follow. */
+
+-#if __GNUC_PREREQ (2, 7)
++#if __GNUC_PREREQ(2, 7)
+
+ # ifdef __NO_LONG_DOUBLE_MATH
+ # define __tgml(fct) fct
diff --git a/packages/uclibc/uclibc_0.9.29.bb b/packages/uclibc/uclibc_0.9.29.bb
index f00a347aa8..9ec20d61de 100644
--- a/packages/uclibc/uclibc_0.9.29.bb
+++ b/packages/uclibc/uclibc_0.9.29.bb
@@ -7,7 +7,7 @@
# on whether the base patches apply to the selected (SRCDATE) svn release.
#
UCLIBC_BASE ?= "0.9.29"
-PR = "r7"
+PR = "r8"
require uclibc.inc
@@ -16,7 +16,12 @@ PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
SRC_URI += "file://uClibc.machine file://uClibc.distro \
file://errno_values.h.patch;patch=1 \
file://termios.h.patch;patch=1 \
- "
+ file://uClibc-0.9.29-001-fix-mmap.patch;patch=1 \
+ file://uClibc-0.9.29-conditional-sched_affinity.patch;patch=1 \
+ file://uClibc-0.9.29-fix-gethostent_r-failure-retval.patch;patch=1 \
+ file://uClibc-0.9.29-fix-internal_function-definition.patch;patch=1 \
+ file://uClibc-0.9.29-rm-whitespace.patch;patch=1 \
+ "
# mmap-unsigned-shift_bugid1303.patch
# http://uclibc.org/lists/uclibc-cvs/2007-May/011360.html;patch=1"
diff --git a/packages/vlan/vlan_1.9.bb b/packages/vlan/vlan_1.9.bb
new file mode 100644
index 0000000000..3a10e898ab
--- /dev/null
+++ b/packages/vlan/vlan_1.9.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "802.1q vlan support program"
+RRECOMMENDS = "kernel-module-8021q"
+PR = "r0"
+
+S = "${WORKDIR}/vlan/"
+
+SRC_URI = "http://www.candelatech.com/~greear/vlan/vlan.${PV}.tar.gz \
+ "
+
+inherit base
+
+CCFLAGS = "-g -D_GNU_SOURCE -Wall -I${STAGING_INCDIR}"
+LDLIBS = ""
+
+do_compile() {
+ ${CC} ${CCFLAGS} -c vconfig.c
+ ${CC} ${CCFLAGS} ${LDFLAGS} -o vconfig vconfig.o ${LDLIBS}
+}
+
+do_install() {
+ install -d "${D}${sbindir}"
+ install -m 755 "${S}/vconfig" "${D}${sbindir}/vconfig"
+}
+
diff --git a/packages/webkit/webkit-gtk_svn.bb b/packages/webkit/webkit-gtk_svn.bb
index 7ee08bf5ab..208ec25719 100644
--- a/packages/webkit/webkit-gtk_svn.bb
+++ b/packages/webkit/webkit-gtk_svn.bb
@@ -60,13 +60,6 @@ do_stage() {
}
-# Noooooooooooooooooooooooooooooooooooooooooooo...
-do_unstage() {
- rm ${STAGING_LIBDIR}/libWebKitG* || true
-}
-
-addtask unstage before do_configure
-
PACKAGES =+ "webkit-gtklauncher-dbg webkit-gtklauncher"
FILES_webkit-gtklauncher = "${bindir}/GtkLauncher"
diff --git a/packages/xorg-xserver/xserver-kdrive/gumstix-kmode.patch b/packages/xorg-xserver/xserver-kdrive/gumstix-kmode.patch
new file mode 100644
index 0000000000..56817a7001
--- /dev/null
+++ b/packages/xorg-xserver/xserver-kdrive/gumstix-kmode.patch
@@ -0,0 +1,23 @@
+--- /tmp/kmode.c 2007-10-07 11:49:52.000000000 +0200
++++ xorg-server-1.3.0.0/hw/kdrive/src/kmode.c 2007-10-07 11:51:57.962045000 +0200
+@@ -119,7 +119,19 @@
+ 0, 0, 0, KdSyncNegative, /* 59.940 */
+ },
+
+-
++
++/* gumstix console-vx */
++ { 480, 272, 60, 0, /* VESA */
++ 0, 0, 0, KdSyncNegative, /* 31.469 */
++ 0, 0, 0, KdSyncNegative, /* 59.940 */
++ },
++
++ { 272, 480, 60, 0, /* VESA */
++ 0, 0, 0, KdSyncNegative, /* 31.469 */
++ 0, 0, 0, KdSyncNegative, /* 59.940 */
++ },
++
++
+ /* 800x600 modes */
+ { 800, 600, 85, 56250, /* VESA */
+ 32, 152, 248, KdSyncPositive, /* 53.674 */
diff --git a/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb b/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
index e49650dc61..7822e4079a 100644
--- a/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
+++ b/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
@@ -3,7 +3,7 @@ require xserver-kdrive-common.inc
DEPENDS += "libxkbfile libxcalibrate"
PE = "1"
-PR = "r18"
+PR = "r19"
SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \
${KDRIVE_COMMON_PATCHES} \
@@ -19,8 +19,10 @@ SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \
file://w100.patch;patch=1 \
file://w100-autofoo.patch;patch=1 \
file://w100-fix-offscreen-bmp.patch;patch=1 \
- file://xorg-avr32-support.diff;patch=1 \
- "
+ file://xorg-avr32-support.diff;patch=1 \
+ file://kdrive-1.3-18bpp.patch;patch=1 \
+ file://gumstix-kmode.patch;patch=1 \
+"
S = "${WORKDIR}/xorg-server-${PV}"
diff --git a/packages/yaffs2/yaffs2-utils-native_cvs.bb b/packages/yaffs2/yaffs2-utils-native_cvs.bb
index 7c6442b77d..d192b52d03 100644
--- a/packages/yaffs2/yaffs2-utils-native_cvs.bb
+++ b/packages/yaffs2/yaffs2-utils-native_cvs.bb
@@ -1,6 +1,6 @@
require yaffs2-utils_cvs.bb
inherit native
-DEPENDS = ""
+DEPENDS = "mtd-utils-native"
CFLAGS += "-I.. -DCONFIG_YAFFS_UTIL"